/ Check-in [ac9ad504]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Issue a warning whenever a double-quoted string literal is used.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ac9ad5043026b30394812457e1535df2759aea0d4510029561e92e386672796f
User & Date: drh 2018-12-06 16:11:14
Context
2018-12-06
16:50
When saving off the value of sqlite3.flags, take care to preserve all 64 bits. check-in: 9c6dbcfa user: drh tags: trunk
16:11
Issue a warning whenever a double-quoted string literal is used. check-in: ac9ad504 user: drh tags: trunk
03:59
Invoking the sqlite3_trace() or sqlite3_trace_v2() interfaces cancels any sqlite3_profile() that is running. check-in: ec63d350 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/resolve.c.

   470    470     **
   471    471     ** Because no reference was made to outer contexts, the pNC->nRef
   472    472     ** fields are not changed in any context.
   473    473     */
   474    474     if( cnt==0 && zTab==0 ){
   475    475       assert( pExpr->op==TK_ID );
   476    476       if( ExprHasProperty(pExpr,EP_DblQuoted) ){
          477  +      /* If a double-quoted identifier does not match any known column name,
          478  +      ** then treat it as a string.
          479  +      **
          480  +      ** This hack was added in the early days of SQLite in a misguided attempt
          481  +      ** to be compatible with MySQL 3.x, which used double-quotes for strings.
          482  +      ** I now sorely regret putting in this hack. The effect of this hack is
          483  +      ** that misspelled identifier names are silently converted into strings
          484  +      ** rather than causing an error, to the frustration of countless
          485  +      ** programmers. To all those frustrated programmers, my apologies.
          486  +      **
          487  +      ** Someday, I hope to get rid of this hack. Unfortunately there is
          488  +      ** a huge amount of legacy SQL that uses it. So for now, we just
          489  +      ** issue a warning.
          490  +      */
          491  +      sqlite3_log(SQLITE_WARNING,
          492  +        "double-quoted string literal: \"%w\"", zCol);
   477    493         pExpr->op = TK_STRING;
   478    494         pExpr->y.pTab = 0;
   479    495         return WRC_Prune;
   480    496       }
   481    497       if( sqlite3ExprIdToTrueFalse(pExpr) ){
   482    498         return WRC_Prune;
   483    499       }