Commit c5bc73e9 authored by unknown's avatar unknown

make all "artificial" syntax errors to report a place where they take place...

make all "artificial" syntax errors to report a place where they take place ("...syntax error ... near ...")


parent 6ea5d81a
...@@ -2157,13 +2157,13 @@ select_init: ...@@ -2157,13 +2157,13 @@ select_init:
SELECT_LEX * sel= lex->current_select; SELECT_LEX * sel= lex->current_select;
if (sel->set_braces(1)) if (sel->set_braces(1))
{ {
send_error(lex->thd, ER_SYNTAX_ERROR); yyerror(ER(ER_SYNTAX_ERROR));
YYABORT; YYABORT;
} }
if (sel->linkage == UNION_TYPE && if (sel->linkage == UNION_TYPE &&
!sel->master_unit()->first_select()->braces) !sel->master_unit()->first_select()->braces)
{ {
send_error(lex->thd, ER_SYNTAX_ERROR); yyerror(ER(ER_SYNTAX_ERROR));
YYABORT; YYABORT;
} }
/* select in braces, can't contain global parameters */ /* select in braces, can't contain global parameters */
...@@ -2179,13 +2179,13 @@ select_init2: ...@@ -2179,13 +2179,13 @@ select_init2:
SELECT_LEX * sel= lex->current_select; SELECT_LEX * sel= lex->current_select;
if (lex->current_select->set_braces(0)) if (lex->current_select->set_braces(0))
{ {
send_error(lex->thd, ER_SYNTAX_ERROR); yyerror(ER(ER_SYNTAX_ERROR));
YYABORT; YYABORT;
} }
if (sel->linkage == UNION_TYPE && if (sel->linkage == UNION_TYPE &&
sel->master_unit()->first_select()->braces) sel->master_unit()->first_select()->braces)
{ {
send_error(lex->thd, ER_SYNTAX_ERROR); yyerror(ER(ER_SYNTAX_ERROR));
YYABORT; YYABORT;
} }
} }
...@@ -2742,7 +2742,7 @@ simple_expr: ...@@ -2742,7 +2742,7 @@ simple_expr:
{ {
if ($1->type() != Item::ROW_ITEM) if ($1->type() != Item::ROW_ITEM)
{ {
send_error(Lex->thd, ER_SYNTAX_ERROR); yyerror(ER(ER_SYNTAX_ERROR));
YYABORT; YYABORT;
} }
$$= new Item_func_interval((Item_row *)$1); $$= new Item_func_interval((Item_row *)$1);
...@@ -3078,7 +3078,7 @@ in_sum_expr: ...@@ -3078,7 +3078,7 @@ in_sum_expr:
LEX *lex= Lex; LEX *lex= Lex;
if (lex->current_select->inc_in_sum_expr()) if (lex->current_select->inc_in_sum_expr())
{ {
send_error(lex->thd, ER_SYNTAX_ERROR); yyerror(ER(ER_SYNTAX_ERROR));
YYABORT; YYABORT;
} }
} }
...@@ -3249,8 +3249,8 @@ select_derived: ...@@ -3249,8 +3249,8 @@ select_derived:
if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN && if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN &&
lex->sql_command <= (int)SQLCOM_HA_READ) || lex->sql_command <= (int)SQLCOM_HA_READ) ||
lex->sql_command == (int)SQLCOM_KILL) lex->sql_command == (int)SQLCOM_KILL)
{ {
send_error(lex->thd, ER_SYNTAX_ERROR); yyerror(ER(ER_SYNTAX_ERROR));
YYABORT; YYABORT;
} }
if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE || if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE ||
...@@ -3885,7 +3885,7 @@ opt_insert_update: ...@@ -3885,7 +3885,7 @@ opt_insert_update:
for a moment */ for a moment */
if (Lex->sql_command != SQLCOM_INSERT) if (Lex->sql_command != SQLCOM_INSERT)
{ {
send_error(Lex->thd, ER_SYNTAX_ERROR); yyerror(ER(ER_SYNTAX_ERROR));
YYABORT; YYABORT;
} }
} }
...@@ -4491,7 +4491,7 @@ param_marker: ...@@ -4491,7 +4491,7 @@ param_marker:
} }
else else
{ {
yyerror("You have an error in your SQL syntax"); yyerror(ER(ER_SYNTAX_ERROR));
YYABORT; YYABORT;
} }
} }
...@@ -5534,7 +5534,7 @@ union_list: ...@@ -5534,7 +5534,7 @@ union_list:
} }
if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
{ {
send_error(lex->thd, ER_SYNTAX_ERROR); yyerror(ER(ER_SYNTAX_ERROR));
YYABORT; YYABORT;
} }
if (mysql_new_select(lex, 0)) if (mysql_new_select(lex, 0))
...@@ -5634,8 +5634,8 @@ subselect_start: ...@@ -5634,8 +5634,8 @@ subselect_start:
if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN && if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN &&
lex->sql_command <= (int)SQLCOM_HA_READ) || lex->sql_command <= (int)SQLCOM_HA_READ) ||
lex->sql_command == (int)SQLCOM_KILL) lex->sql_command == (int)SQLCOM_KILL)
{ {
send_error(lex->thd, ER_SYNTAX_ERROR); yyerror(ER(ER_SYNTAX_ERROR));
YYABORT; YYABORT;
} }
if (mysql_new_select(Lex, 1)) if (mysql_new_select(Lex, 1))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment