MXS-1196: Accept :'a' as placeholder variables

Oracle SQL accepts statements like

  PREPARE stmt FROM 'INSERT INTO t1 VALUES (:a,:b)';
  PREPARE stmt FROM 'INSERT INTO t1 VALUES (:"a",:"b")';

That is, the variable may be surrounded by quotes.
This commit is contained in:
Johan Wikman 2017-05-16 15:28:10 +03:00
parent dece33f7b5
commit e6f8432e33

View File

@ -496,6 +496,20 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){
break;
}else if( c==':' && z[i+1]==':' ){
i++;
#endif
#ifdef MAXSCALE
}else if ( c=='\'' || c=='"' || c=='`' ){
int q=c;
++i;
while ( IdChar(z[i]) ) {
++i;
++n;
}
if ( z[i]==q )
{
++i;
break;
}
#endif
}else{
break;