fix(oracle): preserve hash characters in SQL identifiers
This commit is contained in:
2 files changed
+20
-1
No files matched your search
@@ -1409,7 +1409,10 @@ function startsLineComment(sql: string, pos: number, databaseType?: DatabaseType
|
||||
}
|
||||
|
||||
function startsHashLineComment(sql: string, pos: number, databaseType?: DatabaseType, parameterOptions?: SqlParameterOptions): boolean {
|
||||
if (databaseType === "sqlserver" || sql[pos] !== "#") return false;
|
||||
// `#` is a MySQL-family line-comment marker. Oracle-family engines also allow
|
||||
// it in unquoted identifiers (for example `V$DATAFILE.FILE#`), so treating it
|
||||
// as a comment there truncates otherwise valid statements.
|
||||
if ((databaseType !== undefined && ORACLE_LIKE_PL_SQL_DATABASES.has(databaseType)) || databaseType === "sqlserver" || sql[pos] !== "#") return false;
|
||||
return readSqlBracedParameterAt(sql, pos, parameterOptions)?.syntax !== "mybatis";
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user