Open fowuyu opened 4 years ago
flex_lexer.l define the identifier is:
\"[^\"\n]+\" {
// Crop the leading and trailing quote char
yylval->sval = hsql::substr(yytext, 1, strlen(yytext)-1);
return SQL_IDENTIFIER;
}
change to
\"[^\"\n]+\" {
// Crop the leading and trailing quote char
yylval->sval = hsql::substr(yytext, 0, strlen(yytext));
return SQL_IDENTIFIER;
}
will solve my problem
I don't know whether this change is right,need your comment!
Have a look at the example binary and/or printStatementInfo
:
./a.out "SELECT name FROM foo WHERE name = \"test\""
Parsed successfully!
Number of statements: 1
SelectStatement
Fields:
name
Sources:
foo
Search Conditions:
=
name
test
stmt->whereClause points to a kExprOperator. Only that iterator has the column and the search string.
@mrks Hi,In your case,When you try to get "test"
’s type, you will get kExprColumnRef type;This is my problem.I think "test"
type should be kExprLiteralString.
Ah, sorry. I misunderstood your issue. This is expected and, as far as I understand it, correct. If you look at the SQL documentation, you will find that <double quote>
is used for <delimited identifier>
s while a <character string literal>
uses single quotes.
Some DBMSs (MySQL, sqlite) are more lenient when it comes to the quote type, as you can check on SQLFiddle.
Hello,All When I run this code:
But result is:
I can't understand this output,Is this bug? I hope someone can tell me why this code get so strange output.