From fc33b5ddd7be431d558f8251eb7ef0052a76ad68 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Dec 2005 22:59:45 +0100 Subject: Bug#13012: REPAIR/BACKUP/RESTORE TABLE cause "packet out of order" in SP. Mark them properly as result-returning statements --- sql/sp_head.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql') diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 81e10e59a9b..13d503dfa28 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -107,6 +107,9 @@ sp_get_flags_for_command(LEX *lex) case SQLCOM_SHOW_WARNS: case SQLCOM_SHOW_PROC_CODE: case SQLCOM_SHOW_FUNC_CODE: + case SQLCOM_REPAIR: + case SQLCOM_BACKUP_TABLE: + case SQLCOM_RESTORE_TABLE: flags= sp_head::MULTI_RESULTS; break; /* -- cgit v1.2.1 From 2d29c9ca1c0a1f059e197473fc28aeae2030c596 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Dec 2005 23:01:21 +0100 Subject: german error messages --- sql/share/errmsg.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'sql') diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index f67ad3a9fd2..3eeb2053d9c 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -4590,7 +4590,7 @@ ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 21000 nla "De gebruikte SELECT commando's hebben een verschillend aantal kolommen" eng "The used SELECT statements have a different number of columns" est "Tulpade arv kasutatud SELECT lausetes ei kattu" - ger "Die verwendeten SELECT-Befehle liefern eine unterschiedliche Anzahl von Feldern zurück" + ger "Die verwendeten SELECT-Befehle liefern unterschiedliche Anzahlen von Feldern zurück" ita "La SELECT utilizzata ha un numero di colonne differente" por "Os comandos SELECT usados têm diferente número de colunas" rus "éÓÐÏÌØÚÏ×ÁÎÎÙÅ ÏÐÅÒÁÔÏÒÙ ×ÙÂÏÒËÉ (SELECT) ÄÁÀÔ ÒÁÚÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÓÔÏÌÂÃÏ×" @@ -5274,7 +5274,7 @@ ER_VIEW_SELECT_TMPTABLE ukr "View SELECT ×ÉËÏÒÉÓÔÏ×Õ¤ ÔÉÍÞÁÓÏ×Õ ÔÁÂÌÉÃÀ '%-.64s'" ER_VIEW_WRONG_LIST eng "View's SELECT and view's field list have different column counts" - ger "SELECT- und Feldliste der Views haben eine unterschiedliche Anzahl von Spalten" + ger "SELECT- und Feldliste der Views haben unterschiedliche Anzahlen von Spalten" rus "View SELECT É ÓÐÉÓÏË ÐÏÌÅÊ view ÉÍÅÀÔ ÒÁÚÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÓÔÏÌÂÃÏ×" ukr "View SELECT ¦ ÐÅÒÅÌ¦Ë ÓÔÏ×ÂÃ¦× view ÍÁÀÔØ Ò¦ÚÎÕ Ë¦ÌØË¦ÓÔØ ÓËÏ×Âæ×" ER_WARN_VIEW_MERGE @@ -5485,7 +5485,7 @@ ER_CANT_CREATE_GEOMETRY_OBJECT 22003 ger "Kann kein Geometrieobjekt aus den Daten machen, die Sie dem GEOMETRY-Feld übergeben haben" ER_FAILED_ROUTINE_BREAK_BINLOG eng "A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes" - ger "Eine Routine, die weder NO SQL noch READS SQL DATA in der Deklaration hat, schlug fehl und Binärlogging ist aktiv. Wenn Nicht-Transaktions-Tabellen atualisiert wurden, enthält das Binärlog ihre Änderungen nicht" + ger "Eine Routine, die weder NO SQL noch READS SQL DATA in der Deklaration hat, schlug fehl und Binärlogging ist aktiv. Wenn Nicht-Transaktions-Tabellen aktualisiert wurden, enthält das Binärlog ihre Änderungen nicht" ER_BINLOG_UNSAFE_ROUTINE eng "This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)" ger "Diese Routine hat weder DETERMINISTIC, NO SQL noch READS SQL DATA in der Deklaration und Binärlogging ist aktiv (*vielleicht* sollten Sie die weniger sichere Variable log_bin_trust_routine_creators verwenden)" @@ -5595,8 +5595,11 @@ ER_SP_BAD_VAR_SHADOW 42000 eng "Variable '%-.64s' must be quoted with `...`, or renamed" ger "Variable '%-.64s' muss mit `...` geschützt oder aber umbenannt werden" ER_TRG_NO_DEFINER - eng "No definer attribute for trigger '%-.64s'.'%-.64s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger." + eng "No definer attribute for trigger '%-.64s'.'%-.64s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger." + ger "Kein Definierer-Attribut für Trigger '%-.64s'.'%-.64s'. Der Trigger wird mit der Autorisierung des Aufrufers aktiviert, der möglicherweise keine zureichenden Berechtigungen hat. Bitte legen Sie den Trigger neu an." ER_OLD_FILE_FORMAT - eng "'%-.64s' has an old format, you should re-create the '%s' object(s)" + eng "'%-.64s' has an old format, you should re-create the '%s' object(s)" + ger "'%-.64s' hat altes Format, Sie sollten die '%s'-Objekt(e) neu erzeugen" ER_SP_RECURSION_LIMIT eng "Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.64s" + ger "Rekursionsgrenze %d (durch Variable max_sp_recursion_depth gegeben) wurde für Routine %.64s überschritten" -- cgit v1.2.1 From 6506ce3bcba9a6c53a760e380b2f544738fc0d0d Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 3 Dec 2005 15:02:09 +0100 Subject: this has nothing to do with the bug#13012. it's about mysql_admin_commands not being reexecution-safe (and CHECK still isn't) mysql-test/r/sp-error.result: optimize is now allowed in SP mysql-test/r/sp.result: test repair/optimize/analyze in SP mysql-test/t/backup.test: clean up after itself mysql-test/t/sp-error.test: optimize is now allowed in SP mysql-test/t/sp.test: test repair/optimize/analyze in SP sql/sp_head.cc: all mysql_admin commands return result set sql/sql_parse.cc: all mysql_admin commands modify table list and we should restore it for SP sql/sql_table.cc: optimization - don't execute views when no view is expected/allowed sql/sql_yacc.yy: optimize is now allowed in SP --- sql/sp_head.cc | 4 ++++ sql/sql_parse.cc | 13 ++++++++++++- sql/sql_table.cc | 7 +++++-- sql/sql_yacc.yy | 5 ----- 4 files changed, 21 insertions(+), 8 deletions(-) (limited to 'sql') diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 13d503dfa28..a0a4e0a462f 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -72,7 +72,11 @@ sp_get_flags_for_command(LEX *lex) } /* fallthrough */ case SQLCOM_ANALYZE: + case SQLCOM_OPTIMIZE: + case SQLCOM_PRELOAD_KEYS: + case SQLCOM_ASSIGN_TO_KEYCACHE: case SQLCOM_CHECKSUM: + case SQLCOM_CHECK: case SQLCOM_HA_READ: case SQLCOM_SHOW_BINLOGS: case SQLCOM_SHOW_BINLOG_EVENTS: diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c05529da745..0cc45a09015 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2614,7 +2614,8 @@ mysql_execute_command(THD *thd) goto error; /* purecov: inspected */ thd->enable_slow_log= opt_log_slow_admin_statements; res = mysql_backup_table(thd, first_table); - + (TABLE_LIST*) select_lex->table_list.first=first_table; + lex->query_tables=all_tables; break; } case SQLCOM_RESTORE_TABLE: @@ -2626,6 +2627,8 @@ mysql_execute_command(THD *thd) goto error; /* purecov: inspected */ thd->enable_slow_log= opt_log_slow_admin_statements; res = mysql_restore_table(thd, first_table); + (TABLE_LIST*) select_lex->table_list.first=first_table; + lex->query_tables=all_tables; break; } case SQLCOM_ASSIGN_TO_KEYCACHE: @@ -3128,6 +3131,8 @@ end_with_restore_list: mysql_bin_log.write(&qinfo); } } + (TABLE_LIST*) select_lex->table_list.first=first_table; + lex->query_tables=all_tables; break; } case SQLCOM_CHECK: @@ -3138,6 +3143,8 @@ end_with_restore_list: goto error; /* purecov: inspected */ thd->enable_slow_log= opt_log_slow_admin_statements; res = mysql_check_table(thd, first_table, &lex->check_opt); + (TABLE_LIST*) select_lex->table_list.first=first_table; + lex->query_tables=all_tables; break; } case SQLCOM_ANALYZE: @@ -3158,6 +3165,8 @@ end_with_restore_list: mysql_bin_log.write(&qinfo); } } + (TABLE_LIST*) select_lex->table_list.first=first_table; + lex->query_tables=all_tables; break; } @@ -3181,6 +3190,8 @@ end_with_restore_list: mysql_bin_log.write(&qinfo); } } + (TABLE_LIST*) select_lex->table_list.first=first_table; + lex->query_tables=all_tables; break; } case SQLCOM_UPDATE: diff --git a/sql/sql_table.cc b/sql/sql_table.cc index ae7e618f5df..20186d781f9 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2222,9 +2222,12 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, */ lex->query_tables= table; lex->query_tables_last= &table->next_global; - lex->query_tables_own_last= 0;; + lex->query_tables_own_last= 0; thd->no_warnings_for_error= no_warnings_for_error; - open_and_lock_tables(thd, table); + if (view_operator_func == NULL) + simple_open_n_lock_tables(thd, table); + else + open_and_lock_tables(thd, table); thd->no_warnings_for_error= 0; table->next_global= save_next_global; table->next_local= save_next_local; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 3c478e6d52f..35449fc8398 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3779,11 +3779,6 @@ optimize: OPTIMIZE opt_no_write_to_binlog table_or_tables { LEX *lex=Lex; - if (lex->sphead) - { - my_error(ER_SP_BADSTATEMENT, MYF(0), "OPTIMIZE TABLE"); - YYABORT; - } lex->sql_command = SQLCOM_OPTIMIZE; lex->no_write_to_binlog= $2; lex->check_opt.init(); -- cgit v1.2.1 From 8cf0316339b908bfb1ce37a57f3bbb8b4c84cdc9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Dec 2005 12:08:30 +0100 Subject: better error for optimize/repair/etc a view --- sql/sql_table.cc | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'sql') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 20186d781f9..ba4a606537f 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2225,18 +2225,11 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, lex->query_tables_own_last= 0; thd->no_warnings_for_error= no_warnings_for_error; if (view_operator_func == NULL) - simple_open_n_lock_tables(thd, table); - else - open_and_lock_tables(thd, table); + table->required_type=FRMTYPE_TABLE; + open_and_lock_tables(thd, table); thd->no_warnings_for_error= 0; table->next_global= save_next_global; table->next_local= save_next_local; - /* if view are unsupported */ - if (table->view && view_operator_func == NULL) - { - result_code= HA_ADMIN_NOT_BASE_TABLE; - goto send_result; - } thd->open_options&= ~extra_open_options; if (prepare_func) -- cgit v1.2.1