File tree 3 files changed +9
-2
lines changed
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -835,13 +835,14 @@ static int isLeftOperand(int tokenType){
835
835
** This function should return non-zero if the specified token type is
836
836
** a keyword that requires the next token to be a table identifier.
837
837
*/
838
- static int requiresTableId (int tokenType ){
838
+ static int requiresTableId (int tokenType , int useStrId ){
839
839
switch ( tokenType ){
840
840
case TK_FROM :
841
841
case TK_JOIN :
842
842
case TK_INTO :
843
843
case TK_UPDATE :
844
844
case TK_TABLE : return 1 ;
845
+ case TK_SPACE : return useStrId ;
845
846
default : return 0 ;
846
847
}
847
848
}
@@ -964,7 +965,6 @@ char *sqlite3Normalize_alternate(
964
965
/* fall through */
965
966
}
966
967
default : {
967
- useStrId = requiresTableId (tokenType );
968
968
if ( sqlite3IsIdChar (zSql [i ]) ) addSpaceSeparator (pStr );
969
969
j = pStr -> nChar ;
970
970
sqlite3_str_append (pStr , zSql + i , n );
@@ -975,6 +975,7 @@ char *sqlite3Normalize_alternate(
975
975
break ;
976
976
}
977
977
}
978
+ useStrId = requiresTableId (tokenType , useStrId );
978
979
}
979
980
if ( tokenType != TK_SEMI ) sqlite3_str_append (pStr , ";" , 1 );
980
981
return sqlite3_str_finish (pStr );
Original file line number Diff line number Diff line change
1
+ SELECT * FROM 'sqlite_stat1' LIMIT 0 -- should show table name
2
+ SELECT * FROM comdb2_transaction_logs('{1:0}') LIMIT 0 -- should not show arguments for hidden columns
3
+ SELECT fingerprint, normalized_sql FROM comdb2_fingerprints WHERE fingerprint='002dcfc6d511a5d625fa142f7f0df9f4'
4
+ SELECT fingerprint, normalized_sql FROM comdb2_fingerprints WHERE fingerprint='c30b0528f036eab64a7953ed7c55af40'
Original file line number Diff line number Diff line change
1
+ (fingerprint='002dcfc6d511a5d625fa142f7f0df9f4', normalized_sql='SELECT*FROM sqlite_stat1 LIMIT?;')
2
+ (fingerprint='c30b0528f036eab64a7953ed7c55af40', normalized_sql='SELECT*FROM comdb2_transaction_logs(?)LIMIT?;')
You can’t perform that action at this time.
0 commit comments