Skip to content

Commit

Permalink
implement CREATE DATABASE
Browse files Browse the repository at this point in the history
that is fake (stub) command, just returning 'ok'.

That should fix #3537
  • Loading branch information
klirichek committed May 24, 2023
1 parent a0735ff commit 6aca32f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/sphinxql_extra.l
Expand Up @@ -71,7 +71,8 @@ FLOAT_CONSTANT ({INT}\.{INT}?|{INT}?\.{INT}){EXPONENT}?
<QSTR>[^'\n\\]+
<QSTR>' { Q_END; BEGIN(INITIAL); return TOK_QUOTED_STRING; }


"CREATE" { STORE_BOUNDS; return TOK_CREATE; }
"DATABASE" { STORE_BOUNDS; return TOK_DATABASE; }
"FIELDS" { STORE_BOUNDS; return TOK_FIELDS; }
"FLUSH" { STORE_BOUNDS; return TOK_FLUSH; }
"FROM" { STORE_BOUNDS; return TOK_FROM; }
Expand Down
13 changes: 12 additions & 1 deletion src/sphinxql_extra.y
Expand Up @@ -15,6 +15,8 @@
%token TOK_IDENT "identifier"
%token TOK_QUOTED_STRING "string"

%token TOK_CREATE
%token TOK_DATABASE
%token TOK_FIELDS
%token TOK_FLUSH
%token TOK_FROM
Expand Down Expand Up @@ -57,14 +59,15 @@ statement:
| savepoint_sp
| show_fields
| show_triggers
| create_database
;

//////////////////////////////////////////////////////////////////////////

ident:
TOK_FIELDS | TOK_FLUSH | TOK_FROM | TOK_LOCK | TOK_READ | TOK_RELOAD | TOK_SAVEPOINT
| TOK_SET | TOK_SHOW | TOK_TABLE | TOK_TABLES | TOK_UNLOCK | TOK_USE | TOK_WITH | TOK_IDENT
| TOK_TRIGGERS | TOK_LIKE
| TOK_TRIGGERS | TOK_LIKE | TOK_CREATE | TOK_DATABASE
; // no TOK_SESSION, no TOK_GLOBAL

//////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -213,6 +216,14 @@ like_filter:
| TOK_LIKE TOK_QUOTED_STRING { pParser->m_pStmt->m_sStringParam = pParser->ToStringUnescape ($2 ); }
;


create_database:
TOK_CREATE TOK_DATABASE ident
{
pParser->DefaultOk();
}
;

%%

#if _WIN32
Expand Down

0 comments on commit 6aca32f

Please sign in to comment.