From 6b3478ec1248825122f837411704ab387651b715 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 31 Jul 2005 12:49:55 +0300 Subject: 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. client/client_priv.h: Added OPT_TRIGGERS (to get rid of compiler warning) client/mysql.cc: Added cast to get rid of compiler warning client/mysqldump.c: Added OPT_TRIGGERS (to get rid of compiler warning) Abort if we can't write to outfile (even if --ignore-errors is given) client/mysqltest.c: Added --enable_parsning and --disable_parsing to avoid to have to comment parts of tests include/my_sys.h: Make my_progname const include/my_time.h: Avoid using 'bool' in C programs mysql-test/lib/init_db.sql: Align with mysql_create_system_tables (Ideally this file should be auto-generated from the above script) mysql-test/r/mysqltest.result: Test for --enable_parsing mysql-test/r/variables.result: Update results after fix for overflow checking of max_heap_table_size mysql-test/t/information_schema.test: USe --enable/disable parsing instead of comments mysql-test/t/mysqltest.test: Test for --enable_parsing mysql-test/t/sp.test: USe --enable/disable parsing instead of comments mysql-test/t/variables.test: Portability fix for 64 bit systems mysql-test/t/view.test: USe --enable/disable parsing instead of comments mysys/my_init.c: May my_progname const mysys/my_static.c: May my_progname const mysys/thr_lock.c: Remove not needed casts sql-common/my_time.c: Change bool -> my_bool as bool is not portable in C programs sql/field.cc: Test number_to_datetime() for -1 instead of < 0 (Safety fix) New prototype for TIME_to_timestamp() sql/item.h: Don't have prototypes for both uint32 and ulong as these 'may' be the same thing sql/item_timefunc.cc: New prototype for TIME_to_timestamp() sql/log.cc: Remove compiler warnings sql/mysql_priv.h: New prototype for TIME_to_timestamp() Added function for comparing LEX_STRING sql/set_var.cc: Added overflow checking when setting ulong variable sql/sql_base.cc: Added function is_equal() Changed strncmp -> is_equal() as strncmp() to not match "V" (instead of "VIEW") sql/sql_class.cc: Added comment sql/sql_select.cc: Portability fixes After review fixes sql/sql_trigger.cc: Use 'tables_alias_charset' for comparing database name Use 'is_equal()' to compare file type. (Old code didn't do the comparison correctly) sql/sql_view.cc: Use 'is_equal()' to compare file type. (Old code didn't do the comparison correctly) sql/time.cc: New prototype for TIME_to_timestamp() to allow easyer mapping to C function sql/tztime.cc: bool -> my_bool (to allow calling C code from C++ code) sql/tztime.h: bool -> my_bool (to allow calling C code from C++ code) --- sql/sql_trigger.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'sql/sql_trigger.cc') 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); } -- cgit v1.2.1