summaryrefslogtreecommitdiff
path: root/sql/sql_trigger.cc
diff options
context:
space:
mode:
authormonty@mishka.local <>2005-07-31 12:49:55 +0300
committermonty@mishka.local <>2005-07-31 12:49:55 +0300
commit8437e9c1be5b925a46640302a391af9c9cf83a30 (patch)
treec4df327e7bc6c594e03c6454dddbc63a93203c6a /sql/sql_trigger.cc
parente60d786dde7bfec95a16967bb57d8c570af8ac9e (diff)
downloadmariadb-git-8437e9c1be5b925a46640302a391af9c9cf83a30.tar.gz
Fixes during review of new pushed code
Change bool in C code to my_bool Added to mysqltest --enable_parsning and --disable_parsing to avoid to have to comment parts of tests Added comparison of LEX_STRING's and use this to compare file types for view and trigger files.
Diffstat (limited to 'sql/sql_trigger.cc')
-rw-r--r--sql/sql_trigger.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 976fac3d9c9..34bd0eababe 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -226,7 +226,7 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables)
/* Trigger must be in the same schema as target table. */
- if (my_strcasecmp(system_charset_info, table->s->db,
+ if (my_strcasecmp(table_alias_charset, table->s->db,
lex->spname->m_db.str ? lex->spname->m_db.str :
thd->db))
{
@@ -396,7 +396,7 @@ bool Table_triggers_list::drop_trigger(THD *thd, TABLE_LIST *tables)
{
it_def++;
- if (my_strcasecmp(system_charset_info, lex->spname->m_name.str,
+ if (my_strcasecmp(table_alias_charset, lex->spname->m_name.str,
name->str) == 0)
{
/*
@@ -541,8 +541,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
if ((parser= sql_parse_prepare(&path, &table->mem_root, 1)))
{
- if (!strncmp(triggers_file_type.str, parser->type()->str,
- parser->type()->length))
+ if (is_equal(&triggers_file_type, parser->type()))
{
Table_triggers_list *triggers=
new (&table->mem_root) Table_triggers_list(table);
@@ -601,7 +600,8 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
triggers->bodies[lex.trg_chistics.event]
[lex.trg_chistics.action_time]= lex.sphead;
- if (triggers->names_list.push_back(&lex.sphead->m_name, &table->mem_root))
+ if (triggers->names_list.push_back(&lex.sphead->m_name,
+ &table->mem_root))
goto err_with_lex_cleanup;
if (names_only)
@@ -615,8 +615,9 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
in old/new versions of row in trigger to Field objects in table being
opened.
- We ignore errors here, because if even something is wrong we still will
- be willing to open table to perform some operations (e.g. SELECT)...
+ We ignore errors here, because if even something is wrong we still
+ will be willing to open table to perform some operations
+ (e.g. SELECT)...
Anyway some things can be checked only during trigger execution.
*/
for (Item_trigger_field *trg_field=
@@ -647,7 +648,7 @@ err_with_lex_cleanup:
be merged into .FRM anyway.
*/
my_error(ER_WRONG_OBJECT, MYF(0),
- table_name, triggers_file_ext, "TRIGGER");
+ table_name, triggers_file_ext+1, "TRIGGER");
DBUG_RETURN(1);
}
@@ -726,10 +727,9 @@ static TABLE_LIST *add_table_for_trigger(THD *thd, sp_name *trig)
if (!(parser= sql_parse_prepare(&path, thd->mem_root, 1)))
DBUG_RETURN(0);
- if (strncmp(trigname_file_type.str, parser->type()->str,
- parser->type()->length))
+ if (!is_equal(&trigname_file_type, parser->type()))
{
- my_error(ER_WRONG_OBJECT, MYF(0), trig->m_name.str, trigname_file_ext,
+ my_error(ER_WRONG_OBJECT, MYF(0), trig->m_name.str, trigname_file_ext+1,
"TRIGGERNAME");
DBUG_RETURN(0);
}