Skip to content

Commit badf398

Browse files
committed
Don't detect CHAR as function (only as data-type)
Fixes #811
1 parent 16863c5 commit badf398

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/languages/transactsql/transactsql.functions.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ export const functions: string[] = [
233233

234234
// string
235235
'ASCII',
236-
'CHAR',
237236
'CHARINDEX',
238237
'CONCAT',
239238
'CONCAT_WS',
@@ -243,7 +242,6 @@ export const functions: string[] = [
243242
'LEN',
244243
'LOWER',
245244
'LTRIM',
246-
'NCHAR',
247245
'PATINDEX',
248246
'QUOTENAME',
249247
'REPLACE',

test/transactsql.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,11 @@ describe('TransactSqlFormatter', () => {
190190
GOTO InfiniLoop;
191191
`);
192192
});
193+
194+
// Issue #811
195+
it('does not detect CHAR() as function', () => {
196+
expect(format(`CREATE TABLE foo (name char(65));`, { functionCase: 'upper' })).toBe(dedent`
197+
CREATE TABLE foo (name char(65));
198+
`);
199+
});
193200
});

0 commit comments

Comments
 (0)