summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-11-12 14:34:00 +0200
committerunknown <bell@sanja.is.com.ua>2004-11-12 14:34:00 +0200
commita31c2d3dfc4f4f8ddea0743d104fb1b6cb9a37a9 (patch)
tree7591e416fa1685ed1e41707824091a5ca7f9c2c1 /sql/sql_yacc.yy
parent188b8931e7858afae845f14d29eed0f59876fc2e (diff)
downloadmariadb-git-a31c2d3dfc4f4f8ddea0743d104fb1b6cb9a37a9.tar.gz
post-review fixes
mysql-test/r/rpl_rotate_logs.result: removed host dependence in error messages mysql-test/t/rpl_rotate_logs.test: removed host dependence in error messages mysys/my_error.c: comment about using my_error family functions sql/filesort.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/ha_innodb.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/handler.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/item.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/item_cmpfunc.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/item_func.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/item_strfunc.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/item_subselect.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/item_sum.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/lock.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/log.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/mysql_priv.h: error check moved to fill_record sql/mysqld.cc: fixed error messages sql/parse_file.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/protocol.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/protocol_cursor.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/repl_failsafe.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/set_var.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/slave.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sp.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sp_head.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sp_rcontext.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_acl.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_analyse.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_base.cc: changing my_error on my_message and my_printf_error where if they are prefered error check moved to fill_record sql/sql_class.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_class.h: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_db.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_delete.cc: changing my_error on my_message and my_printf_error where if they are prefered error check moved to fill_record sql/sql_handler.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_help.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_insert.cc: changing my_error on my_message and my_printf_error where if they are prefered error check moved to fill_record sql/sql_lex.cc: layout fixed sql/sql_load.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_map.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_parse.cc: error check moved to fill_record changing my_error on my_message and my_printf_error where if they are prefered sql/sql_prepare.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_rename.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_repl.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_select.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_show.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_table.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_trigger.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_udf.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_union.cc: error check moved to fill_record sql/sql_update.cc: error check moved to fill_record sql/sql_view.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/sql_yacc.yy: changing my_error on my_message and my_printf_error where if they are prefered sql/table.cc: changing my_error on my_message and my_printf_error where if they are prefered sql/unireg.cc: changing my_error on my_message and my_printf_error where if they are prefered
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy217
1 files changed, 136 insertions, 81 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index bdeb5a7d98d..ccffefc4b8e 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -813,7 +813,7 @@ query:
if (!thd->bootstrap &&
(!(thd->lex->select_lex.options & OPTION_FOUND_COMMENT)))
{
- my_error(ER_EMPTY_QUERY, MYF(0));
+ my_message(ER_EMPTY_QUERY, ER(ER_EMPTY_QUERY), MYF(0));
YYABORT;
}
else
@@ -1463,7 +1463,8 @@ sp_fdparam:
if (spc->find_pvar(&$1, TRUE))
{
- my_error(ER_SP_DUP_PARAM, MYF(0), $1.str);
+ my_printf_error(ER_SP_DUP_PARAM, ER(ER_SP_DUP_PARAM), MYF(0),
+ $1.str);
YYABORT;
}
spc->push_pvar(&$1, (enum enum_field_types)$2, sp_param_in);
@@ -1489,7 +1490,8 @@ sp_pdparam:
if (spc->find_pvar(&$2, TRUE))
{
- my_error(ER_SP_DUP_PARAM, MYF(0), $2.str);
+ my_printf_error(ER_SP_DUP_PARAM, ER(ER_SP_DUP_PARAM), MYF(0),
+ $2.str);
YYABORT;
}
spc->push_pvar(&$2, (enum enum_field_types)$3,
@@ -1523,12 +1525,14 @@ sp_decls:
better error handling this way.) */
if (($2.vars || $2.conds) && ($1.curs || $1.hndlrs))
{ /* Variable or condition following cursor or handler */
- my_error(ER_SP_VARCOND_AFTER_CURSHNDLR, MYF(0));
+ my_message(ER_SP_VARCOND_AFTER_CURSHNDLR,
+ ER(ER_SP_VARCOND_AFTER_CURSHNDLR), MYF(0));
YYABORT;
}
if ($2.curs && $1.hndlrs)
{ /* Cursor following handler */
- my_error(ER_SP_CURSOR_AFTER_HANDLER, MYF(0));
+ my_message(ER_SP_CURSOR_AFTER_HANDLER,
+ ER(ER_SP_CURSOR_AFTER_HANDLER), MYF(0));
YYABORT;
}
$$.vars= $1.vars + $2.vars;
@@ -1576,7 +1580,8 @@ sp_decl:
if (spc->find_cond(&$2, TRUE))
{
- my_error(ER_SP_DUP_COND, MYF(0), $2.str);
+ my_printf_error(ER_SP_DUP_COND, ER(ER_SP_DUP_COND), MYF(0),
+ $2.str);
YYABORT;
}
YYTHD->lex->spcont->push_cond(&$2, $5);
@@ -1633,7 +1638,8 @@ sp_decl:
if (ctx->find_cursor(&$2, &offp, TRUE))
{
- my_error(ER_SP_DUP_CURS, MYF(0), $2.str);
+ my_printf_error(ER_SP_DUP_CURS, ER(ER_SP_DUP_CURS), MYF(0),
+ $2.str);
delete $5;
YYABORT;
}
@@ -1660,12 +1666,14 @@ sp_cursor_stmt:
if (lex->sql_command != SQLCOM_SELECT)
{
- my_error(ER_SP_BAD_CURSOR_QUERY, MYF(0));
+ my_message(ER_SP_BAD_CURSOR_QUERY, ER(ER_SP_BAD_CURSOR_QUERY),
+ MYF(0));
YYABORT;
}
if (lex->result)
{
- my_error(ER_SP_BAD_CURSOR_SELECT, MYF(0));
+ my_message(ER_SP_BAD_CURSOR_SELECT, ER(ER_SP_BAD_CURSOR_SELECT),
+ MYF(0));
YYABORT;
}
lex->sp_lex_in_use= TRUE;
@@ -1735,7 +1743,8 @@ sp_hcond:
$$= Lex->spcont->find_cond(&$1);
if ($$ == NULL)
{
- my_error(ER_SP_COND_MISMATCH, MYF(0), $1.str);
+ my_printf_error(ER_SP_COND_MISMATCH, ER(ER_SP_COND_MISMATCH),
+ MYF(0), $1.str);
YYABORT;
}
}
@@ -1764,7 +1773,8 @@ sp_decl_idents:
if (spc->find_pvar(&$1, TRUE))
{
- my_error(ER_SP_DUP_VAR, MYF(0), $1.str);
+ my_printf_error(ER_SP_DUP_VAR, ER(ER_SP_DUP_VAR), MYF(0),
+ $1.str);
YYABORT;
}
spc->push_pvar(&$1, (enum_field_types)0, sp_param_in);
@@ -1777,7 +1787,8 @@ sp_decl_idents:
if (spc->find_pvar(&$3, TRUE))
{
- my_error(ER_SP_DUP_VAR, MYF(0), $3.str);
+ my_printf_error(ER_SP_DUP_VAR, ER(ER_SP_DUP_VAR), MYF(0),
+ $3.str);
YYABORT;
}
spc->push_pvar(&$3, (enum_field_types)0, sp_param_in);
@@ -1810,7 +1821,7 @@ sp_proc_stmt:
}
if (lex->sql_command == SQLCOM_CHANGE_DB)
{ /* "USE db" doesn't work in a procedure */
- my_error(ER_SP_NO_USE, MYF(0));
+ my_message(ER_SP_NO_USE, ER(ER_SP_NO_USE), MYF(0));
YYABORT;
}
/* Don't add an instruction for empty SET statements.
@@ -1829,7 +1840,7 @@ sp_proc_stmt:
*/
if (sp->m_type != TYPE_ENUM_PROCEDURE)
{
- my_error(ER_SP_BADSTATEMENT, MYF(0));
+ my_message(ER_SP_BADSTATEMENT, ER(ER_SP_BADSTATEMENT), MYF(0));
YYABORT;
}
else
@@ -1859,7 +1870,7 @@ sp_proc_stmt:
if (lex->sphead->m_type == TYPE_ENUM_PROCEDURE)
{
- my_error(ER_SP_BADRETURN, MYF(0));
+ my_message(ER_SP_BADRETURN, ER(ER_SP_BADRETURN), MYF(0));
YYABORT;
}
else
@@ -1868,7 +1879,7 @@ sp_proc_stmt:
if ($2->type() == Item::SUBSELECT_ITEM)
{ /* QQ For now, just disallow subselects as values */
- my_error(ER_SP_BADSTATEMENT, MYF(0));
+ my_message(ER_SP_BADSTATEMENT, ER(ER_SP_BADSTATEMENT), MYF(0));
YYABORT;
}
i= new sp_instr_freturn(lex->sphead->instructions(),
@@ -1931,7 +1942,9 @@ sp_proc_stmt:
if (! lab)
{
- my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "LEAVE", $2.str);
+ my_printf_error(ER_SP_LILABEL_MISMATCH,
+ ER(ER_SP_LILABEL_MISMATCH), MYF(0),
+ "LEAVE", $2.str);
YYABORT;
}
else
@@ -1961,7 +1974,9 @@ sp_proc_stmt:
if (! lab || lab->type != SP_LAB_ITER)
{
- my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "ITERATE", $2.str);
+ my_printf_error(ER_SP_LILABEL_MISMATCH,
+ ER(ER_SP_LILABEL_MISMATCH), MYF(0),
+ "ITERATE", $2.str);
YYABORT;
}
else
@@ -1989,7 +2004,8 @@ sp_proc_stmt:
if (lab)
{
- my_error(ER_SP_LABEL_REDEFINE, MYF(0), $2.str);
+ my_printf_error(ER_SP_LABEL_REDEFINE,
+ ER(ER_SP_LABEL_REDEFINE), MYF(0), $2.str);
YYABORT;
}
else
@@ -2013,7 +2029,7 @@ sp_proc_stmt:
if (sp->m_in_handler)
{
- my_error(ER_SP_GOTO_IN_HNDLR, MYF(0));
+ my_message(ER_SP_GOTO_IN_HNDLR, ER(ER_SP_GOTO_IN_HNDLR), MYF(0));
YYABORT;
}
lab= ctx->find_label($2.str);
@@ -2064,7 +2080,8 @@ sp_proc_stmt:
if (! lex->spcont->find_cursor(&$2, &offset))
{
- my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $2.str);
+ my_printf_error(ER_SP_CURSOR_MISMATCH,
+ ER(ER_SP_CURSOR_MISMATCH), MYF(0), $2.str);
YYABORT;
}
i= new sp_instr_copen(sp->instructions(), lex->spcont, offset);
@@ -2079,7 +2096,8 @@ sp_proc_stmt:
if (! lex->spcont->find_cursor(&$2, &offset))
{
- my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $2.str);
+ my_printf_error(ER_SP_CURSOR_MISMATCH,
+ ER(ER_SP_CURSOR_MISMATCH), MYF(0), $2.str);
YYABORT;
}
i= new sp_instr_cfetch(sp->instructions(), lex->spcont, offset);
@@ -2096,7 +2114,8 @@ sp_proc_stmt:
if (! lex->spcont->find_cursor(&$2, &offset))
{
- my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $2.str);
+ my_printf_error(ER_SP_CURSOR_MISMATCH,
+ ER(ER_SP_CURSOR_MISMATCH), MYF(0), $2.str);
YYABORT;
}
i= new sp_instr_cclose(sp->instructions(), lex->spcont, offset);
@@ -2114,7 +2133,8 @@ sp_fetch_list:
if (!spc || !(spv = spc->find_pvar(&$1)))
{
- my_error(ER_SP_UNDECLARED_VAR, MYF(0), $1.str);
+ my_printf_error(ER_SP_UNDECLARED_VAR,
+ ER(ER_SP_UNDECLARED_VAR), MYF(0), $1.str);
YYABORT;
}
else
@@ -2136,7 +2156,8 @@ sp_fetch_list:
if (!spc || !(spv = spc->find_pvar(&$3)))
{
- my_error(ER_SP_UNDECLARED_VAR, MYF(0), $3.str);
+ my_printf_error(ER_SP_UNDECLARED_VAR,
+ ER(ER_SP_UNDECLARED_VAR), MYF(0), $3.str);
YYABORT;
}
else
@@ -2260,7 +2281,8 @@ sp_labeled_control:
if (lab)
{
- my_error(ER_SP_LABEL_REDEFINE, MYF(0), $1.str);
+ my_printf_error(ER_SP_LABEL_REDEFINE,
+ ER(ER_SP_LABEL_REDEFINE), MYF(0), $1.str);
YYABORT;
}
else
@@ -2281,7 +2303,8 @@ sp_labeled_control:
if (!lab ||
my_strcasecmp(system_charset_info, $5.str, lab->name) != 0)
{
- my_error(ER_SP_LABEL_MISMATCH, MYF(0), $5.str);
+ my_printf_error(ER_SP_LABEL_MISMATCH,
+ ER(ER_SP_LABEL_MISMATCH), MYF(0), $5.str);
YYABORT;
}
}
@@ -2539,9 +2562,11 @@ default_charset:
cinfo->default_table_charset && $4 &&
!my_charset_same(cinfo->default_table_charset,$4))
{
- my_error(ER_CONFLICTING_DECLARATIONS, MYF(0),
- "CHARACTER SET ", cinfo->default_table_charset->csname,
- "CHARACTER SET ", $4->csname);
+ my_printf_error(ER_CONFLICTING_DECLARATIONS,
+ ER(ER_CONFLICTING_DECLARATIONS), MYF(0),
+ "CHARACTER SET ",
+ cinfo->default_table_charset->csname,
+ "CHARACTER SET ", $4->csname);
YYABORT;
}
Lex->create_info.default_table_charset= $4;
@@ -2556,8 +2581,9 @@ default_collation:
cinfo->default_table_charset && $4 &&
!my_charset_same(cinfo->default_table_charset,$4))
{
- my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
- $4->name, cinfo->default_table_charset->csname);
+ my_printf_error(ER_COLLATION_CHARSET_MISMATCH,
+ ER(ER_COLLATION_CHARSET_MISMATCH), MYF(0),
+ $4->name, cinfo->default_table_charset->csname);
YYABORT;
}
Lex->create_info.default_table_charset= $4;
@@ -2569,7 +2595,8 @@ storage_engines:
{
$$ = ha_resolve_by_name($1.str,$1.length);
if ($$ == DB_TYPE_UNKNOWN) {
- my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str);
+ my_printf_error(ER_UNKNOWN_STORAGE_ENGINE,
+ ER(ER_UNKNOWN_STORAGE_ENGINE), MYF(0), $1.str);
YYABORT;
}
};
@@ -2755,9 +2782,10 @@ type:
Lex->uint_geom_type= (uint)$1;
$$=FIELD_TYPE_GEOMETRY;
#else
- my_error(ER_FEATURE_DISABLED, MYF(0)
- sym_group_geom.name,
- sym_group_geom.needed_define);
+ my_printf_error(ER_FEATURE_DISABLED,
+ ER(ER_FEATURE_DISABLED), MYF(0)
+ sym_group_geom.name,
+ sym_group_geom.needed_define);
YYABORT;
#endif
}
@@ -2924,8 +2952,9 @@ attribute:
{
if (Lex->charset && !my_charset_same(Lex->charset,$2))
{
- my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
- $2->name,Lex->charset->csname);
+ my_printf_error(ER_COLLATION_CHARSET_MISMATCH,
+ ER(ER_COLLATION_CHARSET_MISMATCH), MYF(0),
+ $2->name,Lex->charset->csname);
YYABORT;
}
else
@@ -2950,7 +2979,8 @@ charset_name:
{
if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))))
{
- my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str);
+ my_printf_error(ER_UNKNOWN_CHARACTER_SET,
+ ER(ER_UNKNOWN_CHARACTER_SET), MYF(0), $1.str);
YYABORT;
}
}
@@ -2968,7 +2998,8 @@ old_or_new_charset_name:
if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))) &&
!($$=get_old_charset_by_name($1.str)))
{
- my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str);
+ my_printf_error(ER_UNKNOWN_CHARACTER_SET,
+ ER(ER_UNKNOWN_CHARACTER_SET), MYF(0), $1.str);
YYABORT;
}
}
@@ -2984,7 +3015,8 @@ collation_name:
{
if (!($$=get_charset_by_name($1.str,MYF(0))))
{
- my_error(ER_UNKNOWN_COLLATION, MYF(0), $1.str);
+ my_printf_error(ER_UNKNOWN_COLLATION,
+ ER(ER_UNKNOWN_COLLATION), MYF(0), $1.str);
YYABORT;
}
};
@@ -3073,8 +3105,9 @@ key_type:
#ifdef HAVE_SPATIAL
$$= Key::SPATIAL;
#else
- my_error(ER_FEATURE_DISABLED, MYF(0),
- sym_group_geom.name, sym_group_geom.needed_define);
+ my_printf_error(ER_FEATURE_DISABLED,
+ ER(ER_FEATURE_DISABLED), MYF(0),
+ sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
#endif
};
@@ -3106,7 +3139,7 @@ opt_unique_or_fulltext:
#ifdef HAVE_SPATIAL
$$= Key::SPATIAL;
#else
- my_error(ER_FEATURE_DISABLED, MYF(0),
+ my_message(ER_FEATURE_DISABLED, ER(ER_FEATURE_DISABLED), MYF(0),
sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
#endif
@@ -3332,7 +3365,8 @@ alter_list_item:
if (check_table_name($3->table.str,$3->table.length) ||
$3->db.str && check_db_name($3->db.str))
{
- my_error(ER_WRONG_TABLE_NAME, MYF(0), $3->table.str);
+ my_printf_error(ER_WRONG_TABLE_NAME, ER(ER_WRONG_TABLE_NAME),
+ MYF(0), $3->table.str);
YYABORT;
}
lex->alter_info.flags|= ALTER_RENAME;
@@ -3347,8 +3381,9 @@ alter_list_item:
$5= $5 ? $5 : $4;
if (!my_charset_same($4,$5))
{
- my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
- $5->name, $4->csname);
+ my_printf_error(ER_COLLATION_CHARSET_MISMATCH,
+ ER(ER_COLLATION_CHARSET_MISMATCH), MYF(0),
+ $5->name, $4->csname);
YYABORT;
}
LEX *lex= Lex;
@@ -3470,7 +3505,8 @@ slave_until:
!((lex->mi.log_file_name && lex->mi.pos) ||
(lex->mi.relay_log_name && lex->mi.relay_log_pos)))
{
- my_error(ER_BAD_SLAVE_UNTIL_COND, MYF(0));
+ my_message(ER_BAD_SLAVE_UNTIL_COND,
+ ER(ER_BAD_SLAVE_UNTIL_COND), MYF(0));
YYABORT;
}
@@ -4183,9 +4219,10 @@ simple_expr:
{
if (!$1.symbol->create_func)
{
- my_error(ER_FEATURE_DISABLED, MYF(0),
- $1.symbol->group->name,
- $1.symbol->group->needed_define);
+ my_printf_error(ER_FEATURE_DISABLED,
+ ER(ER_FEATURE_DISABLED), MYF(0),
+ $1.symbol->group->name,
+ $1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(void))($1.symbol->create_func))();
@@ -4194,9 +4231,10 @@ simple_expr:
{
if (!$1.symbol->create_func)
{
- my_error(ER_FEATURE_DISABLED, MYF(0),
- $1.symbol->group->name,
- $1.symbol->group->needed_define);
+ my_printf_error(ER_FEATURE_DISABLED,
+ ER(ER_FEATURE_DISABLED), MYF(0),
+ $1.symbol->group->name,
+ $1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(Item*))($1.symbol->create_func))($3);
@@ -4205,9 +4243,10 @@ simple_expr:
{
if (!$1.symbol->create_func)
{
- my_error(ER_FEATURE_DISABLED, MYF(0),
- $1.symbol->group->name,
- $1.symbol->group->needed_define);
+ my_printf_error(ER_FEATURE_DISABLED,
+ ER(ER_FEATURE_DISABLED), MYF(0),
+ $1.symbol->group->name,
+ $1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(Item*,Item*))($1.symbol->create_func))($3,$5);
@@ -4216,9 +4255,10 @@ simple_expr:
{
if (!$1.symbol->create_func)
{
- my_error(ER_FEATURE_DISABLED, MYF(0),
- $1.symbol->group->name,
- $1.symbol->group->needed_define);
+ my_printf_error(ER_FEATURE_DISABLED,
+ ER(ER_FEATURE_DISABLED), MYF(0),
+ $1.symbol->group->name,
+ $1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(Item*,Item*,Item*))($1.symbol->create_func))($3,$5,$7);
@@ -4321,8 +4361,9 @@ simple_expr:
#ifdef HAVE_SPATIAL
$$= $1;
#else
- my_error(ER_FEATURE_DISABLED, MYF(0),
- sym_group_geom.name, sym_group_geom.needed_define);
+ my_printf_error(ER_FEATURE_DISABLED,
+ ER(ER_FEATURE_DISABLED), MYF(0),
+ sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
#endif
}
@@ -5378,7 +5419,8 @@ select_var_ident:
if (!lex->spcont || !(t=lex->spcont->find_pvar(&$1)))
{
- my_error(ER_SP_UNDECLARED_VAR, MYF(0), $1.str);
+ my_printf_error(ER_SP_UNDECLARED_VAR,
+ ER(ER_SP_UNDECLARED_VAR), MYF(0), $1.str);
YYABORT;
}
if (! lex->result)
@@ -5733,8 +5775,9 @@ update:
else if (lex->select_lex.get_table_list()->derived)
{
/* it is single table update and it is update of derived table */
- my_error(ER_NON_UPDATABLE_TABLE, MYF(0),
- lex->select_lex.get_table_list()->alias, "UPDATE");
+ my_printf_error(ER_NON_UPDATABLE_TABLE,
+ ER(ER_NON_UPDATABLE_TABLE), MYF(0),
+ lex->select_lex.get_table_list()->alias, "UPDATE");
YYABORT;
}
}
@@ -6241,7 +6284,8 @@ kill:
LEX *lex=Lex;
if ($3->fix_fields(lex->thd, 0, &$3) || $3->check_cols(1))
{
- my_error(ER_SET_CONSTANTS_ONLY, MYF(0));
+ my_message(ER_SET_CONSTANTS_ONLY, ER(ER_SET_CONSTANTS_ONLY),
+ MYF(0));
YYABORT;
}
lex->sql_command=SQLCOM_KILL;
@@ -6388,7 +6432,7 @@ param_marker:
(uchar *) thd->query));
if (!($$= item) || lex->param_list.push_back(item))
{
- my_error(ER_OUT_OF_RESOURCES, MYF(0));
+ my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
YYABORT;
}
}
@@ -6564,8 +6608,9 @@ simple_ident_q:
FIXME. Far from perfect solution. See comment for
"SET NEW.field_name:=..." for more info.
*/
- my_error(ER_BAD_FIELD_ERROR, MYF(0), $3.str,
- new_row ? "NEW": "OLD");
+ my_printf_error(ER_BAD_FIELD_ERROR,
+ ER(ER_BAD_FIELD_ERROR), MYF(0),
+ $3.str, new_row ? "NEW": "OLD");
YYABORT;
}
@@ -6652,8 +6697,9 @@ IDENT_sys:
$1.length);
if (wlen < $1.length)
{
- my_error(ER_INVALID_CHARACTER_STRING, MYF(0), cs->csname,
- $1.str + wlen);
+ my_printf_error(ER_INVALID_CHARACTER_STRING,
+ ER(ER_INVALID_CHARACTER_STRING), MYF(0),
+ cs->csname, $1.str + wlen);
YYABORT;
}
$$= $1;
@@ -7032,7 +7078,8 @@ option_value:
*/
if (lex->query_tables)
{
- my_error(ER_SP_SUBSELECT_NYI, MYF(0));
+ my_message(ER_SP_SUBSELECT_NYI, ER(ER_SP_SUBSELECT_NYI),
+ MYF(0));
YYABORT;
}
sp_instr_set_user_var *i=
@@ -7055,7 +7102,8 @@ option_value:
sp_instr_set_trigger_field *i;
if (lex->query_tables)
{
- my_error(ER_SP_SUBSELECT_NYI, MYF(0));
+ my_message(ER_SP_SUBSELECT_NYI, ER(ER_SP_SUBSELECT_NYI),
+ MYF(0));
YYABORT;
}
if ($3)
@@ -7084,7 +7132,8 @@ option_value:
Error message also should be improved.
*/
- my_error(ER_BAD_FIELD_ERROR, MYF(0), $1.base_name, "NEW");
+ my_printf_error(ER_BAD_FIELD_ERROR, ER(ER_BAD_FIELD_ERROR),
+ MYF(0), $1.base_name, "NEW");
YYABORT;
}
lex->sphead->add_instr(i);
@@ -7150,8 +7199,9 @@ option_value:
$3= $3 ? $3 : $2;
if (!my_charset_same($2,$3))
{
- my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
- $3->name, $2->csname);
+ my_printf_error(ER_COLLATION_CHARSET_MISMATCH,
+ ER(ER_COLLATION_CHARSET_MISMATCH), MYF(0),
+ $3->name, $2->csname);
YYABORT;
}
lex->var_list.push_back(new set_var_collation_client($3,$3,$3));
@@ -7241,7 +7291,8 @@ internal_variable_name:
if (!tmp)
YYABORT;
if (!tmp->is_struct())
- my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), $3.str);
+ my_printf_error(ER_VARIABLE_IS_NOT_STRUCT,
+ ER(ER_VARIABLE_IS_NOT_STRUCT), MYF(0), $3.str);
$$.var= tmp;
$$.base_name= $1;
}
@@ -7252,7 +7303,8 @@ internal_variable_name:
if (!tmp)
YYABORT;
if (!tmp->is_struct())
- my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), $3.str);
+ my_printf_error(ER_VARIABLE_IS_NOT_STRUCT,
+ ER(ER_VARIABLE_IS_NOT_STRUCT), MYF(0), $3.str);
$$.var= tmp;
$$.base_name.str= (char*) "default";
$$.base_name.length= 7;
@@ -7533,7 +7585,8 @@ opt_table:
lex->grant = DB_ACLS & ~GRANT_ACL;
else if (lex->columns.elements)
{
- my_error(ER_ILLEGAL_GRANT_FOR_TABLE, MYF(0));
+ my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
+ ER(ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0));
YYABORT;
}
}
@@ -7545,7 +7598,8 @@ opt_table:
lex->grant = DB_ACLS & ~GRANT_ACL;
else if (lex->columns.elements)
{
- my_error(ER_ILLEGAL_GRANT_FOR_TABLE, MYF(0));
+ my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
+ ER(ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0));
YYABORT;
}
}
@@ -7557,7 +7611,8 @@ opt_table:
lex->grant= GLOBAL_ACLS & ~GRANT_ACL;
else if (lex->columns.elements)
{
- my_error(ER_ILLEGAL_GRANT_FOR_TABLE, MYF(0));
+ my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
+ ER(ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0));
YYABORT;
}
}