summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorpem@mysql.com <>2003-09-24 11:29:38 +0200
committerpem@mysql.com <>2003-09-24 11:29:38 +0200
commit8d884c02bb2ca2f2b4bce6dccbaf69d6935e293d (patch)
tree4f2fa31d20ec4c9a54f602c624b20c1cf4ddf493 /sql/sql_table.cc
parentefd94f5ba972bb10d2d10fe46fc9153536941e92 (diff)
parentb8e4dc03d809838f6f589ef24089e52ea806da33 (diff)
downloadmariadb-git-8d884c02bb2ca2f2b4bce6dccbaf69d6935e293d.tar.gz
Merging 4.1 -> 5.0
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc39
1 files changed, 14 insertions, 25 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 5e4971a7372..59d8535fedf 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -256,15 +256,11 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
if (some_tables_deleted || tmp_table_deleted)
{
query_cache_invalidate3(thd, tables, 0);
- if (!dont_log_query)
+ if (!dont_log_query && mysql_bin_log.is_open())
{
- mysql_update_log.write(thd, thd->query,thd->query_length);
- if (mysql_bin_log.is_open())
- {
- Query_log_event qinfo(thd, thd->query, thd->query_length,
- tmp_table_deleted && !some_tables_deleted);
- mysql_bin_log.write(&qinfo);
- }
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
+ tmp_table_deleted && !some_tables_deleted);
+ mysql_bin_log.write(&qinfo);
}
}
@@ -943,17 +939,13 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
}
thd->tmp_table_used= 1;
}
- if (!tmp_table && !no_log)
- {
+ if (!tmp_table && !no_log && mysql_bin_log.is_open())
// Must be written before unlock
- mysql_update_log.write(thd,thd->query, thd->query_length);
- if (mysql_bin_log.is_open())
- {
- Query_log_event qinfo(thd, thd->query, thd->query_length,
- test(create_info->options &
- HA_LEX_CREATE_TMP_TABLE));
- mysql_bin_log.write(&qinfo);
- }
+ {
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
+ test(create_info->options &
+ HA_LEX_CREATE_TMP_TABLE));
+ mysql_bin_log.write(&qinfo);
}
error=0;
end:
@@ -1200,7 +1192,7 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table,
}
else
{
- char* backup_dir = thd->lex.backup_dir;
+ char* backup_dir = thd->lex->backup_dir;
char src_path[FN_REFLEN], dst_path[FN_REFLEN];
char* table_name = table->real_name;
char* db = thd->db ? thd->db : table->db;
@@ -1893,7 +1885,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
if (!error)
{
- mysql_update_log.write(thd, thd->query, thd->query_length);
if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
@@ -2276,7 +2267,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
my_free((gptr) new_table,MYF(0));
goto err;
}
- mysql_update_log.write(thd, thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
@@ -2408,7 +2398,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
goto err;
}
thd->proc_info="end";
- mysql_update_log.write(thd, thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
@@ -2506,8 +2495,8 @@ copy_data_between_tables(TABLE *from,TABLE *to,
tables.db = from->table_cache_key;
error=1;
- if (thd->lex.select_lex.setup_ref_array(thd, order_num) ||
- setup_order(thd, thd->lex.select_lex.ref_pointer_array,
+ if (thd->lex->select_lex.setup_ref_array(thd, order_num) ||
+ setup_order(thd, thd->lex->select_lex.ref_pointer_array,
&tables, fields, all_fields, order) ||
!(sortorder=make_unireg_sortorder(order, &length)) ||
(from->sort.found_records = filesort(thd, from, sortorder, length,
@@ -2537,7 +2526,7 @@ copy_data_between_tables(TABLE *from,TABLE *to,
{
if (thd->killed)
{
- my_error(ER_SERVER_SHUTDOWN,MYF(0));
+ thd->send_kill_message();
error= 1;
break;
}