summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-10-20 04:04:37 +0300
committerunknown <bell@sanja.is.com.ua>2004-10-20 04:04:37 +0300
commit066c90563a9fd6151461a5d54d879079acffe279 (patch)
tree55e6ec4a0a572c0be2ba69da166ea204bf96502e /sql/sql_yacc.yy
parent65ed693681b17414fc001099ee734f36de847f13 (diff)
downloadmariadb-git-066c90563a9fd6151461a5d54d879079acffe279.tar.gz
errors without code removed
net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed (WL#2133) include/mysqld_error.h: new errors added. mysql-test/r/rpl_charset.result: new error mysql-test/r/rpl_timezone.result: new error mysql-test/r/sp-security.result: more clean error message mysql-test/r/sp.result: now error state intercepted correctly mysql-test/t/connect.test: new error message mysql-test/t/rpl_charset.test: new error message mysql-test/t/rpl_timezone.test: new error mysql-test/t/sp-security.test: more correct error handling mysql-test/t/sp.test: now error state intercepted correctly sql/ha_innodb.cc: -1/1 (sent/unsent) error reporting removed sql/ha_innodb.h: -1/1 (sent/unsent) error reporting removed sql/item.cc: only boolean values should be returned by fix_fields() sql/item_cmpfunc.cc: only boolean values should be returned by fix_fields() sql/item_func.cc: only boolean values should be returned by fix_fields() net_printf/send_error calls replaced by my_error family functions sql/item_row.cc: only boolean values should be returned by fix_fields() sql/item_subselect.cc: only boolean values should be returned by fix_fields() -1/1 (sent/unsent) error reporting removed sql/item_subselect.h: -1/1 (sent/unsent) error reporting removed sql/item_sum.cc: only boolean values should be returned by fix_fields() sql/item_timefunc.cc: only boolean values should be returned by fix_fields() sql/item_uniq.h: only boolean values should be returned by fix_fields() sql/mysql_priv.h: -1/1 (sent/unsent) error reporting removed sql/mysqld.cc: net_printf/send_error calls replaced by my_error family functions changes in my_message_sql to support error handling correctly sql/protocol.cc: net_printf/send_error calls replaced by my_error family functions sql/protocol_cursor.cc: net_printf/send_error calls replaced by my_error family functions sql/repl_failsafe.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/repl_failsafe.h: -1/1 (sent/unsent) error reporting removed sql/set_var.cc: net_printf/send_error calls replaced by my_error family functions sql/share/czech/errmsg.txt: new error messages sql/share/danish/errmsg.txt: new error messages sql/share/dutch/errmsg.txt: new error messages sql/share/english/errmsg.txt: new error messages sql/share/estonian/errmsg.txt: new error messages sql/share/french/errmsg.txt: new error messages sql/share/german/errmsg.txt: new error messages sql/share/greek/errmsg.txt: new error messages sql/share/hungarian/errmsg.txt: new error messages sql/share/italian/errmsg.txt: new error messages sql/share/japanese/errmsg.txt: new error messages sql/share/korean/errmsg.txt: new error messages sql/share/norwegian-ny/errmsg.txt: new error messages sql/share/norwegian/errmsg.txt: new error messages sql/share/polish/errmsg.txt: new error messages sql/share/portuguese/errmsg.txt: new error messages sql/share/romanian/errmsg.txt: new error messages sql/share/russian/errmsg.txt: new error messages sql/share/serbian/errmsg.txt: new error messages sql/share/slovak/errmsg.txt: new error messages sql/share/spanish/errmsg.txt: new error messages sql/share/swedish/errmsg.txt: new error messages sql/share/ukrainian/errmsg.txt: new error messages sql/slave.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/slave.h: -1/1 (sent/unsent) error reporting removed sql/sp.cc: net_printf/send_error calls replaced by my_error family functions sql/sp_head.cc: new eror handling support net_printf/send_error calls replaced by my_error family functions sql/sp_rcontext.cc: net_printf/send_error calls replaced by my_error family functions sql/sql_acl.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_acl.h: -1/1 (sent/unsent) error reporting removed sql/sql_base.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_class.cc: net_printf/send_error calls replaced by my_error family functions sql/sql_class.h: my_messhage_sql now set/reset query_error flag sql/sql_db.cc: -1/1 (sent/unsent) error reporting removed sql/sql_delete.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_do.cc: -1/1 (sent/unsent) error reporting removed sql/sql_error.cc: -1/1 (sent/unsent) error reporting removed sql/sql_handler.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_help.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_insert.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_lex.h: -1/1 (sent/unsent) error reporting removed sql/sql_load.cc: -1/1 (sent/unsent) error reporting removed sql/sql_map.cc: errors without code removed sql/sql_parse.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed from mysql_execute_command sql/sql_prepare.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_repl.cc: error messages fixed net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_repl.h: -1/1 (sent/unsent) error reporting removed sql/sql_select.cc: -1/1 (sent/unsent) error reporting removed sql/sql_select.h: -1/1 (sent/unsent) error reporting removed sql/sql_show.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_table.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_trigger.cc: -1/1 (sent/unsent) error reporting removed sql/sql_udf.cc: net_printf/send_error calls replaced by my_error family functions sql/sql_union.cc: -1/1 (sent/unsent) error reporting removed sql/sql_update.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_view.cc: -1/1 (sent/unsent) error reporting removed sql/sql_view.h: -1/1 (sent/unsent) error reporting removed sql/sql_yacc.yy: net_printf/send_error calls replaced by my_error family functions
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy236
1 files changed, 116 insertions, 120 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 31016b59c6f..fe25d689b4b 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -810,7 +810,7 @@ query:
if (!thd->bootstrap &&
(!(thd->lex->select_lex.options & OPTION_FOUND_COMMENT)))
{
- send_error(thd,ER_EMPTY_QUERY);
+ my_error(ER_EMPTY_QUERY, MYF(0));
YYABORT;
}
else
@@ -1146,7 +1146,7 @@ create:
if (lex->sphead)
{
- net_printf(YYTHD, ER_SP_NO_RECURSIVE_CREATE, "PROCEDURE");
+ my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "PROCEDURE");
YYABORT;
}
/* Order is important here: new - reset - init */
@@ -1219,7 +1219,7 @@ create:
if (lex->sphead)
{
- net_printf(YYTHD, ER_SP_NO_RECURSIVE_CREATE, "TRIGGER");
+ my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "TRIGGER");
YYABORT;
}
@@ -1300,7 +1300,7 @@ create_function_tail:
if (lex->sphead)
{
- net_printf(YYTHD, ER_SP_NO_RECURSIVE_CREATE, "FUNCTION");
+ my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "FUNCTION");
YYABORT;
}
/* Order is important here: new - reset - init */
@@ -1455,7 +1455,7 @@ sp_fdparam:
if (spc->find_pvar(&$1, TRUE))
{
- net_printf(YYTHD, ER_SP_DUP_PARAM, $1.str);
+ my_error(ER_SP_DUP_PARAM, MYF(0), $1.str);
YYABORT;
}
spc->push_pvar(&$1, (enum enum_field_types)$2, sp_param_in);
@@ -1481,7 +1481,7 @@ sp_pdparam:
if (spc->find_pvar(&$2, TRUE))
{
- net_printf(YYTHD, ER_SP_DUP_PARAM, $2.str);
+ my_error(ER_SP_DUP_PARAM, MYF(0), $2.str);
YYABORT;
}
spc->push_pvar(&$2, (enum enum_field_types)$3,
@@ -1515,12 +1515,12 @@ sp_decls:
better error handling this way.) */
if (($2.vars || $2.conds) && ($1.curs || $1.hndlrs))
{ /* Variable or condition following cursor or handler */
- send_error(YYTHD, ER_SP_VARCOND_AFTER_CURSHNDLR);
+ my_error(ER_SP_VARCOND_AFTER_CURSHNDLR, MYF(0));
YYABORT;
}
if ($2.curs && $1.hndlrs)
{ /* Cursor following handler */
- send_error(YYTHD, ER_SP_CURSOR_AFTER_HANDLER);
+ my_error(ER_SP_CURSOR_AFTER_HANDLER, MYF(0));
YYABORT;
}
$$.vars= $1.vars + $2.vars;
@@ -1568,7 +1568,7 @@ sp_decl:
if (spc->find_cond(&$2, TRUE))
{
- net_printf(YYTHD, ER_SP_DUP_COND, $2.str);
+ my_error(ER_SP_DUP_COND, MYF(0), $2.str);
YYABORT;
}
YYTHD->lex->spcont->push_cond(&$2, $5);
@@ -1625,7 +1625,7 @@ sp_decl:
if (ctx->find_cursor(&$2, &offp, TRUE))
{
- net_printf(YYTHD, ER_SP_DUP_CURS, $2.str);
+ my_error(ER_SP_DUP_CURS, MYF(0), $2.str);
delete $5;
YYABORT;
}
@@ -1652,12 +1652,12 @@ sp_cursor_stmt:
if (lex->sql_command != SQLCOM_SELECT)
{
- send_error(YYTHD, ER_SP_BAD_CURSOR_QUERY);
+ my_error(ER_SP_BAD_CURSOR_QUERY, MYF(0));
YYABORT;
}
if (lex->result)
{
- send_error(YYTHD, ER_SP_BAD_CURSOR_SELECT);
+ my_error(ER_SP_BAD_CURSOR_SELECT, MYF(0));
YYABORT;
}
lex->sp_lex_in_use= TRUE;
@@ -1727,7 +1727,7 @@ sp_hcond:
$$= Lex->spcont->find_cond(&$1);
if ($$ == NULL)
{
- net_printf(YYTHD, ER_SP_COND_MISMATCH, $1.str);
+ my_error(ER_SP_COND_MISMATCH, MYF(0), $1.str);
YYABORT;
}
}
@@ -1756,7 +1756,7 @@ sp_decl_idents:
if (spc->find_pvar(&$1, TRUE))
{
- net_printf(YYTHD, ER_SP_DUP_VAR, $1.str);
+ my_error(ER_SP_DUP_VAR, MYF(0), $1.str);
YYABORT;
}
spc->push_pvar(&$1, (enum_field_types)0, sp_param_in);
@@ -1769,7 +1769,7 @@ sp_decl_idents:
if (spc->find_pvar(&$3, TRUE))
{
- net_printf(YYTHD, ER_SP_DUP_VAR, $3.str);
+ my_error(ER_SP_DUP_VAR, MYF(0), $3.str);
YYABORT;
}
spc->push_pvar(&$3, (enum_field_types)0, sp_param_in);
@@ -1802,7 +1802,7 @@ sp_proc_stmt:
}
if (lex->sql_command == SQLCOM_CHANGE_DB)
{ /* "USE db" doesn't work in a procedure */
- send_error(YYTHD, ER_SP_NO_USE);
+ my_error(ER_SP_NO_USE, MYF(0));
YYABORT;
}
/* Don't add an instruction for empty SET statements.
@@ -1821,7 +1821,7 @@ sp_proc_stmt:
*/
if (sp->m_type != TYPE_ENUM_PROCEDURE)
{
- send_error(YYTHD, ER_SP_BADSTATEMENT);
+ my_error(ER_SP_BADSTATEMENT, MYF(0));
YYABORT;
}
else
@@ -1851,7 +1851,7 @@ sp_proc_stmt:
if (lex->sphead->m_type == TYPE_ENUM_PROCEDURE)
{
- send_error(YYTHD, ER_SP_BADRETURN);
+ my_error(ER_SP_BADRETURN, MYF(0));
YYABORT;
}
else
@@ -1860,7 +1860,7 @@ sp_proc_stmt:
if ($2->type() == Item::SUBSELECT_ITEM)
{ /* QQ For now, just disallow subselects as values */
- send_error(lex->thd, ER_SP_BADSTATEMENT);
+ my_error(ER_SP_BADSTATEMENT, MYF(0));
YYABORT;
}
i= new sp_instr_freturn(lex->sphead->instructions(),
@@ -1923,7 +1923,7 @@ sp_proc_stmt:
if (! lab)
{
- net_printf(YYTHD, ER_SP_LILABEL_MISMATCH, "LEAVE", $2.str);
+ my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "LEAVE", $2.str);
YYABORT;
}
else
@@ -1953,7 +1953,7 @@ sp_proc_stmt:
if (! lab || lab->type != SP_LAB_ITER)
{
- net_printf(YYTHD, ER_SP_LILABEL_MISMATCH, "ITERATE", $2.str);
+ my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "ITERATE", $2.str);
YYABORT;
}
else
@@ -1981,7 +1981,7 @@ sp_proc_stmt:
if (lab)
{
- net_printf(YYTHD, ER_SP_LABEL_REDEFINE, $2.str);
+ my_error(ER_SP_LABEL_REDEFINE, MYF(0), $2.str);
YYABORT;
}
else
@@ -2005,7 +2005,7 @@ sp_proc_stmt:
if (sp->m_in_handler)
{
- send_error(lex->thd, ER_SP_GOTO_IN_HNDLR);
+ my_error(ER_SP_GOTO_IN_HNDLR, MYF(0));
YYABORT;
}
lab= ctx->find_label($2.str);
@@ -2056,7 +2056,7 @@ sp_proc_stmt:
if (! lex->spcont->find_cursor(&$2, &offset))
{
- net_printf(YYTHD, ER_SP_CURSOR_MISMATCH, $2.str);
+ my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $2.str);
YYABORT;
}
i= new sp_instr_copen(sp->instructions(), lex->spcont, offset);
@@ -2071,7 +2071,7 @@ sp_proc_stmt:
if (! lex->spcont->find_cursor(&$2, &offset))
{
- net_printf(YYTHD, ER_SP_CURSOR_MISMATCH, $2.str);
+ my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $2.str);
YYABORT;
}
i= new sp_instr_cfetch(sp->instructions(), lex->spcont, offset);
@@ -2088,7 +2088,7 @@ sp_proc_stmt:
if (! lex->spcont->find_cursor(&$2, &offset))
{
- net_printf(YYTHD, ER_SP_CURSOR_MISMATCH, $2.str);
+ my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $2.str);
YYABORT;
}
i= new sp_instr_cclose(sp->instructions(), lex->spcont, offset);
@@ -2106,7 +2106,7 @@ sp_fetch_list:
if (!spc || !(spv = spc->find_pvar(&$1)))
{
- net_printf(YYTHD, ER_SP_UNDECLARED_VAR, $1.str);
+ my_error(ER_SP_UNDECLARED_VAR, MYF(0), $1.str);
YYABORT;
}
else
@@ -2128,7 +2128,7 @@ sp_fetch_list:
if (!spc || !(spv = spc->find_pvar(&$3)))
{
- net_printf(YYTHD, ER_SP_UNDECLARED_VAR, $3.str);
+ my_error(ER_SP_UNDECLARED_VAR, MYF(0), $3.str);
YYABORT;
}
else
@@ -2252,7 +2252,7 @@ sp_labeled_control:
if (lab)
{
- net_printf(YYTHD, ER_SP_LABEL_REDEFINE, $1.str);
+ my_error(ER_SP_LABEL_REDEFINE, MYF(0), $1.str);
YYABORT;
}
else
@@ -2273,7 +2273,7 @@ sp_labeled_control:
if (!lab ||
my_strcasecmp(system_charset_info, $5.str, lab->name) != 0)
{
- net_printf(YYTHD, ER_SP_LABEL_MISMATCH, $5.str);
+ my_error(ER_SP_LABEL_MISMATCH, MYF(0), $5.str);
YYABORT;
}
}
@@ -2531,9 +2531,9 @@ default_charset:
cinfo->default_table_charset && $4 &&
!my_charset_same(cinfo->default_table_charset,$4))
{
- net_printf(YYTHD, ER_CONFLICTING_DECLARATIONS,
- "CHARACTER SET ", cinfo->default_table_charset->csname,
- "CHARACTER SET ", $4->csname);
+ my_error(ER_CONFLICTING_DECLARATIONS, MYF(0),
+ "CHARACTER SET ", cinfo->default_table_charset->csname,
+ "CHARACTER SET ", $4->csname);
YYABORT;
}
Lex->create_info.default_table_charset= $4;
@@ -2548,8 +2548,8 @@ default_collation:
cinfo->default_table_charset && $4 &&
!my_charset_same(cinfo->default_table_charset,$4))
{
- net_printf(YYTHD,ER_COLLATION_CHARSET_MISMATCH,
- $4->name, cinfo->default_table_charset->csname);
+ my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
+ $4->name, cinfo->default_table_charset->csname);
YYABORT;
}
Lex->create_info.default_table_charset= $4;
@@ -2561,7 +2561,7 @@ storage_engines:
{
$$ = ha_resolve_by_name($1.str,$1.length);
if ($$ == DB_TYPE_UNKNOWN) {
- net_printf(YYTHD, ER_UNKNOWN_STORAGE_ENGINE, $1.str);
+ my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str);
YYABORT;
}
};
@@ -2740,18 +2740,19 @@ type:
$$=FIELD_TYPE_TINY_BLOB; }
| BLOB_SYM opt_len { Lex->charset=&my_charset_bin;
$$=FIELD_TYPE_BLOB; }
- | spatial_type {
+ | spatial_type
+ {
#ifdef HAVE_SPATIAL
- Lex->charset=&my_charset_bin;
- Lex->uint_geom_type= (uint)$1;
- $$=FIELD_TYPE_GEOMETRY;
+ Lex->charset=&my_charset_bin;
+ Lex->uint_geom_type= (uint)$1;
+ $$=FIELD_TYPE_GEOMETRY;
#else
- net_printf(Lex->thd, ER_FEATURE_DISABLED,
- sym_group_geom.name,
- sym_group_geom.needed_define);
- YYABORT;
+ my_error(ER_FEATURE_DISABLED, MYF(0)
+ sym_group_geom.name,
+ sym_group_geom.needed_define);
+ YYABORT;
#endif
- }
+ }
| MEDIUMBLOB { Lex->charset=&my_charset_bin;
$$=FIELD_TYPE_MEDIUM_BLOB; }
| LONGBLOB { Lex->charset=&my_charset_bin;
@@ -2915,8 +2916,8 @@ attribute:
{
if (Lex->charset && !my_charset_same(Lex->charset,$2))
{
- net_printf(YYTHD,ER_COLLATION_CHARSET_MISMATCH,
- $2->name,Lex->charset->csname);
+ my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
+ $2->name,Lex->charset->csname);
YYABORT;
}
else
@@ -2941,7 +2942,7 @@ charset_name:
{
if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))))
{
- net_printf(YYTHD,ER_UNKNOWN_CHARACTER_SET,$1.str);
+ my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str);
YYABORT;
}
}
@@ -2959,7 +2960,7 @@ old_or_new_charset_name:
if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))) &&
!($$=get_old_charset_by_name($1.str)))
{
- net_printf(YYTHD,ER_UNKNOWN_CHARACTER_SET,$1.str);
+ my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str);
YYABORT;
}
}
@@ -2975,7 +2976,7 @@ collation_name:
{
if (!($$=get_charset_by_name($1.str,MYF(0))))
{
- net_printf(YYTHD,ER_UNKNOWN_COLLATION,$1.str);
+ my_error(ER_UNKNOWN_COLLATION, MYF(0), $1.str);
YYABORT;
}
};
@@ -2999,9 +3000,10 @@ opt_binary:
| BYTE_SYM { Lex->charset=&my_charset_bin; }
| UNICODE_SYM
{
- if (!(Lex->charset=get_charset_by_csname("ucs2",MY_CS_PRIMARY,MYF(0))))
+ if (!(Lex->charset=get_charset_by_csname("ucs2",
+ MY_CS_PRIMARY,MYF(0))))
{
- net_printf(YYTHD,ER_UNKNOWN_CHARACTER_SET,"ucs2");
+ my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2");
YYABORT;
}
}
@@ -3063,8 +3065,8 @@ key_type:
#ifdef HAVE_SPATIAL
$$= Key::SPATIAL;
#else
- net_printf(Lex->thd, ER_FEATURE_DISABLED,
- sym_group_geom.name, sym_group_geom.needed_define);
+ my_error(ER_FEATURE_DISABLED, MYF(0),
+ sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
#endif
};
@@ -3096,8 +3098,8 @@ opt_unique_or_fulltext:
#ifdef HAVE_SPATIAL
$$= Key::SPATIAL;
#else
- net_printf(Lex->thd, ER_FEATURE_DISABLED,
- sym_group_geom.name, sym_group_geom.needed_define);
+ my_error(ER_FEATURE_DISABLED, MYF(0),
+ sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
#endif
}
@@ -3324,7 +3326,7 @@ alter_list_item:
if (check_table_name($3->table.str,$3->table.length) ||
$3->db.str && check_db_name($3->db.str))
{
- net_printf(lex->thd,ER_WRONG_TABLE_NAME,$3->table.str);
+ my_error(ER_WRONG_TABLE_NAME, MYF(0), $3->table.str);
YYABORT;
}
lex->alter_info.flags|= ALTER_RENAME;
@@ -3339,8 +3341,8 @@ alter_list_item:
$5= $5 ? $5 : $4;
if (!my_charset_same($4,$5))
{
- net_printf(YYTHD,ER_COLLATION_CHARSET_MISMATCH,
- $5->name,$4->csname);
+ my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
+ $5->name, $4->csname);
YYABORT;
}
LEX *lex= Lex;
@@ -3462,7 +3464,7 @@ slave_until:
!((lex->mi.log_file_name && lex->mi.pos) ||
(lex->mi.relay_log_name && lex->mi.relay_log_pos)))
{
- send_error(lex->thd, ER_BAD_SLAVE_UNTIL_COND);
+ my_error(ER_BAD_SLAVE_UNTIL_COND, MYF(0));
YYABORT;
}
@@ -4175,9 +4177,9 @@ simple_expr:
{
if (!$1.symbol->create_func)
{
- net_printf(Lex->thd, ER_FEATURE_DISABLED,
- $1.symbol->group->name,
- $1.symbol->group->needed_define);
+ my_error(ER_FEATURE_DISABLED, MYF(0),
+ $1.symbol->group->name,
+ $1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(void))($1.symbol->create_func))();
@@ -4186,9 +4188,9 @@ simple_expr:
{
if (!$1.symbol->create_func)
{
- net_printf(Lex->thd, ER_FEATURE_DISABLED,
- $1.symbol->group->name,
- $1.symbol->group->needed_define);
+ my_error(ER_FEATURE_DISABLED, MYF(0),
+ $1.symbol->group->name,
+ $1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(Item*))($1.symbol->create_func))($3);
@@ -4197,9 +4199,9 @@ simple_expr:
{
if (!$1.symbol->create_func)
{
- net_printf(Lex->thd, ER_FEATURE_DISABLED,
- $1.symbol->group->name,
- $1.symbol->group->needed_define);
+ my_error(ER_FEATURE_DISABLED, MYF(0),
+ $1.symbol->group->name,
+ $1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(Item*,Item*))($1.symbol->create_func))($3,$5);
@@ -4208,9 +4210,9 @@ simple_expr:
{
if (!$1.symbol->create_func)
{
- net_printf(Lex->thd, ER_FEATURE_DISABLED,
- $1.symbol->group->name,
- $1.symbol->group->needed_define);
+ my_error(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);
@@ -4311,8 +4313,8 @@ simple_expr:
#ifdef HAVE_SPATIAL
$$= $1;
#else
- net_printf(Lex->thd, ER_FEATURE_DISABLED,
- sym_group_geom.name, sym_group_geom.needed_define);
+ my_error(ER_FEATURE_DISABLED, MYF(0),
+ sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
#endif
}
@@ -5168,12 +5170,12 @@ olap_opt:
LEX *lex=Lex;
if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
{
- net_printf(lex->thd, ER_WRONG_USAGE, "WITH CUBE",
+ my_error(ER_WRONG_USAGE, MYF(0), "WITH CUBE",
"global union parameters");
YYABORT;
}
lex->current_select->olap= CUBE_TYPE;
- net_printf(lex->thd, ER_NOT_SUPPORTED_YET, "CUBE");
+ my_error(ER_NOT_SUPPORTED_YET, MYF(0), "CUBE");
YYABORT; /* To be deleted in 5.1 */
}
| WITH ROLLUP_SYM
@@ -5181,7 +5183,7 @@ olap_opt:
LEX *lex= Lex;
if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
{
- net_printf(lex->thd, ER_WRONG_USAGE, "WITH ROLLUP",
+ my_error(ER_WRONG_USAGE, MYF(0), "WITH ROLLUP",
"global union parameters");
YYABORT;
}
@@ -5205,9 +5207,8 @@ order_clause:
lex->current_select->olap !=
UNSPECIFIED_OLAP_TYPE)
{
- net_printf(lex->thd, ER_WRONG_USAGE,
- "CUBE/ROLLUP",
- "ORDER BY");
+ my_error(ER_WRONG_USAGE, MYF(0),
+ "CUBE/ROLLUP", "ORDER BY");
YYABORT;
}
} order_list;
@@ -5305,9 +5306,7 @@ procedure_clause:
LEX *lex=Lex;
if (&lex->select_lex != lex->current_select)
{
- net_printf(lex->thd, ER_WRONG_USAGE,
- "PROCEDURE",
- "subquery");
+ my_error(ER_WRONG_USAGE, MYF(0), "PROCEDURE", "subquery");
YYABORT;
}
lex->proc_list.elements=0;
@@ -5371,7 +5370,7 @@ select_var_ident:
if (!lex->spcont || !(t=lex->spcont->find_pvar(&$1)))
{
- net_printf(YYTHD, ER_SP_UNDECLARED_VAR, $1.str);
+ my_error(ER_SP_UNDECLARED_VAR, MYF(0), $1.str);
YYABORT;
}
if (! lex->result)
@@ -5466,7 +5465,7 @@ drop:
LEX *lex=Lex;
if (lex->sphead)
{
- net_printf(YYTHD, ER_SP_NO_DROP_SP, "FUNCTION");
+ my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
YYABORT;
}
lex->sql_command = SQLCOM_DROP_FUNCTION;
@@ -5478,7 +5477,7 @@ drop:
LEX *lex=Lex;
if (lex->sphead)
{
- net_printf(YYTHD, ER_SP_NO_DROP_SP, "PROCEDURE");
+ my_error(ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE");
YYABORT;
}
lex->sql_command = SQLCOM_DROP_PROCEDURE;
@@ -5726,8 +5725,8 @@ update:
else if (lex->select_lex.get_table_list()->derived)
{
/* it is single table update and it is update of derived table */
- net_printf(lex->thd, ER_NON_UPDATABLE_TABLE,
- lex->select_lex.get_table_list()->alias, "UPDATE");
+ my_error(ER_NON_UPDATABLE_TABLE, MYF(0),
+ lex->select_lex.get_table_list()->alias, "UPDATE");
YYABORT;
}
}
@@ -6049,7 +6048,7 @@ show_engine_param:
Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS;
break;
default:
- net_printf(YYTHD, ER_NOT_SUPPORTED_YET, "STATUS");
+ my_error(ER_NOT_SUPPORTED_YET, MYF(0), "STATUS");
YYABORT;
}
}
@@ -6060,7 +6059,7 @@ show_engine_param:
Lex->sql_command = SQLCOM_SHOW_LOGS;
break;
default:
- net_printf(YYTHD, ER_NOT_SUPPORTED_YET, "LOGS");
+ my_error(ER_NOT_SUPPORTED_YET, MYF(0), "LOGS");
YYABORT;
}
};
@@ -6212,7 +6211,7 @@ purge_option:
{
if ($2->check_cols(1) || $2->fix_fields(Lex->thd, 0, &$2))
{
- net_printf(Lex->thd, ER_WRONG_ARGUMENTS, "PURGE LOGS BEFORE");
+ my_error(ER_WRONG_ARGUMENTS, MYF(0), "PURGE LOGS BEFORE");
YYABORT;
}
Item *tmp= new Item_func_unix_timestamp($2);
@@ -6234,7 +6233,7 @@ kill:
LEX *lex=Lex;
if ($3->fix_fields(lex->thd, 0, &$3) || $3->check_cols(1))
{
- send_error(lex->thd, ER_SET_CONSTANTS_ONLY);
+ my_error(ER_SET_CONSTANTS_ONLY, MYF(0));
YYABORT;
}
lex->sql_command=SQLCOM_KILL;
@@ -6381,7 +6380,7 @@ param_marker:
(uchar *) thd->query));
if (!($$= item) || lex->param_list.push_back(item))
{
- send_error(thd, ER_OUT_OF_RESOURCES);
+ my_error(ER_OUT_OF_RESOURCES, MYF(0));
YYABORT;
}
}
@@ -6437,7 +6436,6 @@ NUM_literal:
$$= new Item_real($1.str, $1.length);
if (YYTHD->net.report_error)
{
- send_error(YYTHD, 0, NullS);
YYABORT;
}
}
@@ -6446,7 +6444,6 @@ NUM_literal:
$$ = new Item_float($1.str, $1.length);
if (YYTHD->net.report_error)
{
- send_error(YYTHD, 0, NullS);
YYABORT;
}
}
@@ -6541,16 +6538,14 @@ simple_ident_q:
if (lex->trg_chistics.event == TRG_EVENT_INSERT &&
!new_row)
{
- net_printf(YYTHD, ER_TRG_NO_SUCH_ROW_IN_TRG, "OLD",
- "on INSERT");
+ my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), "OLD", "on INSERT");
YYABORT;
}
if (lex->trg_chistics.event == TRG_EVENT_DELETE &&
new_row)
{
- net_printf(YYTHD, ER_TRG_NO_SUCH_ROW_IN_TRG, "NEW",
- "on DELETE");
+ my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), "NEW", "on DELETE");
YYABORT;
}
@@ -6567,8 +6562,8 @@ simple_ident_q:
FIXME. Far from perfect solution. See comment for
"SET NEW.field_name:=..." for more info.
*/
- net_printf(YYTHD, ER_BAD_FIELD_ERROR, $3.str,
- new_row ? "NEW": "OLD");
+ my_error(ER_BAD_FIELD_ERROR, MYF(0), $3.str,
+ new_row ? "NEW": "OLD");
YYABORT;
}
@@ -6655,8 +6650,8 @@ IDENT_sys:
$1.length);
if (wlen < $1.length)
{
- net_printf(YYTHD, ER_INVALID_CHARACTER_STRING, cs->csname,
- $1.str + wlen);
+ my_error(ER_INVALID_CHARACTER_STRING, MYF(0), cs->csname,
+ $1.str + wlen);
YYABORT;
}
$$= $1;
@@ -7034,7 +7029,7 @@ option_value:
*/
if (lex->query_tables)
{
- send_error(YYTHD, ER_SP_SUBSELECT_NYI);
+ my_error(ER_SP_SUBSELECT_NYI, MYF(0));
YYABORT;
}
sp_instr_set_user_var *i=
@@ -7057,7 +7052,7 @@ option_value:
sp_instr_set_trigger_field *i;
if (lex->query_tables)
{
- send_error(YYTHD, ER_SP_SUBSELECT_NYI);
+ my_error(ER_SP_SUBSELECT_NYI, MYF(0));
YYABORT;
}
if ($3)
@@ -7086,7 +7081,7 @@ option_value:
Error message also should be improved.
*/
- net_printf(YYTHD, ER_BAD_FIELD_ERROR, $1.base_name, "NEW");
+ my_error(ER_BAD_FIELD_ERROR, MYF(0), $1.base_name, "NEW");
YYABORT;
}
lex->sphead->add_instr(i);
@@ -7152,7 +7147,8 @@ option_value:
$3= $3 ? $3 : $2;
if (!my_charset_same($2,$3))
{
- net_printf(thd,ER_COLLATION_CHARSET_MISMATCH,$3->name,$2->csname);
+ my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
+ $3->name, $2->csname);
YYABORT;
}
lex->var_list.push_back(new set_var_collation_client($3,$3,$3));
@@ -7218,18 +7214,18 @@ internal_variable_name:
{
if ($1.str[0]=='O' || $1.str[0]=='o')
{
- net_printf(YYTHD, ER_TRG_CANT_CHANGE_ROW, "OLD", "");
+ my_error(ER_TRG_CANT_CHANGE_ROW, MYF(0), "OLD", "");
YYABORT;
}
if (lex->trg_chistics.event == TRG_EVENT_DELETE)
{
- net_printf(YYTHD, ER_TRG_NO_SUCH_ROW_IN_TRG, "NEW",
- "on DELETE");
+ my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0),
+ "NEW", "on DELETE");
YYABORT;
}
if (lex->trg_chistics.action_time == TRG_ACTION_AFTER)
{
- net_printf(YYTHD, ER_TRG_CANT_CHANGE_ROW, "NEW", "after ");
+ my_error(ER_TRG_CANT_CHANGE_ROW, MYF(0), "NEW", "after ");
YYABORT;
}
/* This special combination will denote field of NEW row */
@@ -7242,7 +7238,7 @@ internal_variable_name:
if (!tmp)
YYABORT;
if (!tmp->is_struct())
- net_printf(YYTHD, ER_VARIABLE_IS_NOT_STRUCT, $3.str);
+ my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), $3.str);
$$.var= tmp;
$$.base_name= $1;
}
@@ -7253,7 +7249,7 @@ internal_variable_name:
if (!tmp)
YYABORT;
if (!tmp->is_struct())
- net_printf(YYTHD, ER_VARIABLE_IS_NOT_STRUCT, $3.str);
+ my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), $3.str);
$$.var= tmp;
$$.base_name.str= (char*) "default";
$$.base_name.length= 7;
@@ -7498,7 +7494,7 @@ require_list_element:
LEX *lex=Lex;
if (lex->x509_subject)
{
- net_printf(lex->thd,ER_DUP_ARGUMENT, "SUBJECT");
+ my_error(ER_DUP_ARGUMENT, MYF(0), "SUBJECT");
YYABORT;
}
lex->x509_subject=$2.str;
@@ -7508,7 +7504,7 @@ require_list_element:
LEX *lex=Lex;
if (lex->x509_issuer)
{
- net_printf(lex->thd,ER_DUP_ARGUMENT, "ISSUER");
+ my_error(ER_DUP_ARGUMENT, MYF(0), "ISSUER");
YYABORT;
}
lex->x509_issuer=$2.str;
@@ -7518,7 +7514,7 @@ require_list_element:
LEX *lex=Lex;
if (lex->ssl_cipher)
{
- net_printf(lex->thd,ER_DUP_ARGUMENT, "CIPHER");
+ my_error(ER_DUP_ARGUMENT, MYF(0), "CIPHER");
YYABORT;
}
lex->ssl_cipher=$2.str;
@@ -7534,7 +7530,7 @@ opt_table:
lex->grant = DB_ACLS & ~GRANT_ACL;
else if (lex->columns.elements)
{
- send_error(lex->thd,ER_ILLEGAL_GRANT_FOR_TABLE);
+ my_error(ER_ILLEGAL_GRANT_FOR_TABLE, MYF(0));
YYABORT;
}
}
@@ -7546,7 +7542,7 @@ opt_table:
lex->grant = DB_ACLS & ~GRANT_ACL;
else if (lex->columns.elements)
{
- send_error(lex->thd,ER_ILLEGAL_GRANT_FOR_TABLE);
+ my_error(ER_ILLEGAL_GRANT_FOR_TABLE, MYF(0));
YYABORT;
}
}
@@ -7558,7 +7554,7 @@ opt_table:
lex->grant= GLOBAL_ACLS & ~GRANT_ACL;
else if (lex->columns.elements)
{
- send_error(lex->thd,ER_ILLEGAL_GRANT_FOR_TABLE);
+ my_error(ER_ILLEGAL_GRANT_FOR_TABLE, MYF(0));
YYABORT;
}
}
@@ -7743,7 +7739,7 @@ union_list:
if (lex->exchange)
{
/* Only the last SELECT can have INTO...... */
- net_printf(lex->thd, ER_WRONG_USAGE, "UNION", "INTO");
+ my_error(ER_WRONG_USAGE, MYF(0), "UNION", "INTO");
YYABORT;
}
if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)