summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-09-16 04:27:49 +0300
committerunknown <monty@donna.mysql.com>2000-09-16 04:27:49 +0300
commit8c6b365e7d8f19985e4732024524ac666f0c596c (patch)
treeb87f72722c003b64cdf08c50143e2cb3b2778317 /sql/sql_table.cc
parentff1216a5a9c453b5c131f08687a99105dc1a391a (diff)
parent19b678eefe59529761691ddebece604107dcb42b (diff)
downloadmariadb-git-8c6b365e7d8f19985e4732024524ac666f0c596c.tar.gz
Merge work:/home/bk/mysql into donna.mysql.com:/home/my/bk/mysql
Docs/manual.texi: Auto merged sql/mysql_priv.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_table.cc: Auto merged
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc40
1 files changed, 26 insertions, 14 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 4f770ed53d4..fa309a85bc5 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -117,9 +117,12 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists)
}
if (some_tables_deleted)
{
- mysql_update_log.write(thd->query,thd->query_length);
- Query_log_event qinfo(thd, thd->query);
- mysql_bin_log.write(&qinfo);
+ mysql_update_log.write(thd, thd->query,thd->query_length);
+ if (mysql_bin_log.is_open())
+ {
+ Query_log_event qinfo(thd, thd->query);
+ mysql_bin_log.write(&qinfo);
+ }
}
VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh
@@ -526,9 +529,12 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
if (!tmp_table && !no_log)
{
// Must be written before unlock
- mysql_update_log.write(thd->query, thd->query_length);
- Query_log_event qinfo(thd, thd->query);
- mysql_bin_log.write(&qinfo);
+ mysql_update_log.write(thd,thd->query, thd->query_length);
+ if (mysql_bin_log.is_open())
+ {
+ Query_log_event qinfo(thd, thd->query);
+ mysql_bin_log.write(&qinfo);
+ }
}
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
{
@@ -1072,9 +1078,12 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
VOID(pthread_mutex_unlock(&LOCK_open));
if (!error)
{
- mysql_update_log.write(thd->query,thd->query_length);
- Query_log_event qinfo(thd, thd->query);
- mysql_bin_log.write(&qinfo);
+ mysql_update_log.write(thd, thd->query, thd->query_length);
+ if (mysql_bin_log.is_open())
+ {
+ Query_log_event qinfo(thd, thd->query);
+ mysql_bin_log.write(&qinfo);
+ }
send_ok(&thd->net);
}
@@ -1363,10 +1372,12 @@ 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->query,thd->query_length);
- Query_log_event qinfo(thd, thd->query);
- mysql_bin_log.write(&qinfo);
-
+ mysql_update_log.write(thd, thd->query,thd->query_length);
+ if (mysql_bin_log.is_open())
+ {
+ Query_log_event qinfo(thd, thd->query);
+ mysql_bin_log.write(&qinfo);
+ }
goto end_temporary;
DBUG_RETURN(0);
}
@@ -1470,7 +1481,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
thd->proc_info="end";
- mysql_update_log.write(thd->query,thd->query_length);
+ mysql_update_log.write(thd, thd->query,thd->query_length);
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query);
mysql_bin_log.write(&qinfo);