Skip to content

Commit

Permalink
try to work around some sqltype issues
Browse files Browse the repository at this point in the history
* unknown type as "errorok"-> to not directly end parsing
* CHARF as alias for CHAR with a warning
* VARCHAR2 as alias for VARCHAR with a warning
  • Loading branch information
GitMensch committed Jun 29, 2023
1 parent 79f6247 commit 2c007f8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libgixpp/gix_esql_parser.yy
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ static std::string to_std_string(connect_to_info_t *i) { if (i) { char buffer [3
%token COMP_5 "COMP-5"
%token COMP
%token<uint64_t> CHAR
%token<uint64_t> CHARF
%token<uint64_t> VARCHAR
%token<uint64_t> VARCHAR2
%token<uint64_t> BINARY
%token<uint64_t> VARBINARY
%token<uint64_t> FLOAT
Expand Down Expand Up @@ -494,6 +496,10 @@ DECLARE_VAR TOKEN IS sql_type END_EXEC {
driver->parser_data()->exec_list()->push_back(stmt);
}
}
| DECLARE_VAR error END_EXEC
{
yyerrok;
}
;

dbid: strliteral_or_hostref { $$ = $1; }
Expand Down Expand Up @@ -911,7 +917,13 @@ sql_type:
BINARY { $$ = (TYPE_SQL_BINARY << 60) + $1; }
| VARBINARY { $$ = (TYPE_SQL_VARBINARY << 60) + $1; }
| CHAR { $$ = (TYPE_SQL_CHAR << 60) + $1; }
| CHARF { $$ = (TYPE_SQL_CHAR << 60) + $1;
driver->warning(@$, "Unsupported SQL TYPE, will handle CHARF as CHAR.");
}
| VARCHAR { $$ = (TYPE_SQL_VARCHAR << 60) + $1; }
| VARCHAR2{ $$ = (TYPE_SQL_VARCHAR << 60) + $1;
driver->warning(@$, "Unsupported SQL TYPE, will handle VARCHAR2 as VARCHAR.");
}
| INTEGER { $$ = (TYPE_SQL_INT << 60) + $1; }
| FLOAT { $$ = (TYPE_SQL_FLOAT << 60) + $1; }
| DECIMAL { $$ = (TYPE_SQL_DECIMAL << 60) + $1; }
Expand Down

0 comments on commit 2c007f8

Please sign in to comment.