SQLite

Check-in [d7211b6810]
Login

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

Overview
Comment:When doing the (dubious) conversion of double-quoted identifier into string literal for MySQL compatibility, be sure to also clear the iTable value from the Expr entry to avoid an assert.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d7211b68107ea669de39e0aa81a1be40901e1487
User & Date: drh 2015-04-15 04:51:28.676
Context
2015-04-15
05:20
When adding the implied "LIMIT 1" to the end of a scalar subquery, make sure that subquery is not a VALUES-only query as such queries cannot deal with LIMIT clauses. (check-in: 7c27310bdf user: drh tags: trunk)
04:51
When doing the (dubious) conversion of double-quoted identifier into string literal for MySQL compatibility, be sure to also clear the iTable value from the Expr entry to avoid an assert. (check-in: d7211b6810 user: drh tags: trunk)
04:20
Add a test case for what was formerly thought to be an unreachable condition: when the LHS of an OR operator contains an error and the RHS contains an IN operator. (check-in: 3872742591 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/resolve.c.
456
457
458
459
460
461
462

463
464
465
466
467
468
469
  **
  ** Because no reference was made to outer contexts, the pNC->nRef
  ** fields are not changed in any context.
  */
  if( cnt==0 && zTab==0 && ExprHasProperty(pExpr,EP_DblQuoted) ){
    pExpr->op = TK_STRING;
    pExpr->pTab = 0;

    return WRC_Prune;
  }

  /*
  ** cnt==0 means there was not match.  cnt>1 means there were two or
  ** more matches.  Either way, we have an error.
  */







>







456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
  **
  ** Because no reference was made to outer contexts, the pNC->nRef
  ** fields are not changed in any context.
  */
  if( cnt==0 && zTab==0 && ExprHasProperty(pExpr,EP_DblQuoted) ){
    pExpr->op = TK_STRING;
    pExpr->pTab = 0;
    pExpr->iTable = -1;
    return WRC_Prune;
  }

  /*
  ** cnt==0 means there was not match.  cnt>1 means there were two or
  ** more matches.  Either way, we have an error.
  */
Changes to test/misc1.test.
634
635
636
637
638
639
640





641
642
#
do_catchsql_test misc1-21.1 {
  select''like''like''like#0;
} {1 {near "#0": syntax error}}
do_catchsql_test misc1-21.2 {
  VALUES(0,0x0MATCH#0;
} {1 {near ";": syntax error}}






finish_test







>
>
>
>
>


634
635
636
637
638
639
640
641
642
643
644
645
646
647
#
do_catchsql_test misc1-21.1 {
  select''like''like''like#0;
} {1 {near "#0": syntax error}}
do_catchsql_test misc1-21.2 {
  VALUES(0,0x0MATCH#0;
} {1 {near ";": syntax error}}

# 2015-04-15
do_execsql_test misc1-22.1 {
  SELECT ""+3 FROM (SELECT ""+5);
} {3}

finish_test