summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2003-12-21 02:07:45 +0200
committerunknown <monty@mysql.com>2003-12-21 02:07:45 +0200
commit5313e6967abd7268d6fa29f3c4ad8428af93ba45 (patch)
treeb4b50b6b03398c2d68a97d79f6b2d07eb470327e
parent026aaab659e6766ce832e1d59fcca2bb89f7feea (diff)
downloadmariadb-git-5313e6967abd7268d6fa29f3c4ad8428af93ba45.tar.gz
Update for VC++
(Fixed project files, compiler warnings etc..) BitKeeper/etc/ignore: added mysql_priv.h VC++Files/libmysqld/libmysqld.dsp: Update for VC++to VC++Files/sql/mysqld.dsp: Update for VC++ client/mysqlbinlog.cc: Remove not used variable sql-common/client.c: Fix for compilation with VC++ sql/filesort.cc: Remove not used variable sql/item_timefunc.cc: Fixed compiler warnings sql/log_event.cc: Fixed compiler warnings - One can't portable allocate an stack-array dynamicly - Changed sql_mode to ulong to match THD.variables.sql_mode (If they are not the same we get a lot of compiler warnings) sql/log_event.h: Changed sql_mode to ulong to match THD.variables.sql_mode (If they are not the same we get a lot of compiler warnings) sql/sp.cc: sql_mode to ulong Don't use strcpy Replaced sprintf() with strmov sql/sp_cache.cc: Fixed compiler warning sql/sp_head.cc: Removed not used variable sql/sp_rcontext.cc: Removed not used variable sql/sp_rcontext.h: Fixed compiler warning sql/sql_class.cc: Portability fix sql/sql_delete.cc: Fixed compiler warning sql/sql_insert.cc: Fixed compiler warning sql/sql_update.cc: Fixed compiler warning
-rw-r--r--.bzrignore1
-rw-r--r--VC++Files/libmysqld/libmysqld.dsp48
-rw-r--r--VC++Files/sql/mysqld.dsp32
-rw-r--r--client/mysqlbinlog.cc1
-rw-r--r--sql-common/client.c4
-rw-r--r--sql/filesort.cc2
-rw-r--r--sql/item_timefunc.cc5
-rw-r--r--sql/log_event.cc27
-rw-r--r--sql/log_event.h6
-rw-r--r--sql/sp.cc20
-rw-r--r--sql/sp_cache.cc2
-rw-r--r--sql/sp_head.cc1
-rw-r--r--sql/sp_rcontext.cc2
-rw-r--r--sql/sp_rcontext.h2
-rw-r--r--sql/sql_class.cc4
-rw-r--r--sql/sql_delete.cc2
-rw-r--r--sql/sql_insert.cc4
-rw-r--r--sql/sql_update.cc2
18 files changed, 115 insertions, 50 deletions
diff --git a/.bzrignore b/.bzrignore
index 5205124092d..2e4fafa52fd 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -647,3 +647,4 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslserver
vio/viotest-ssl
+mysql_priv.h
diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp
index c753b0d8fe7..36d9fcb653c 100644
--- a/VC++Files/libmysqld/libmysqld.dsp
+++ b/VC++Files/libmysqld/libmysqld.dsp
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /c
# SUBTRACT CPP /WX /Fr
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
@@ -70,7 +70,7 @@ LINK32=xilink6.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
+# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "_DEBUG" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
# SUBTRACT CPP /Fr
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
@@ -91,6 +91,10 @@ LINK32=xilink6.exe
# Name "libmysqld - Win32 Debug"
# Begin Source File
+SOURCE=..\libmysql\client.c
+# End Source File
+# Begin Source File
+
SOURCE="..\strings\ctype-latin1.c"
# End Source File
# Begin Source File
@@ -191,11 +195,11 @@ SOURCE=..\sql\item_func.cpp
# End Source File
# Begin Source File
-SOURCE=.\item_geofunc.cpp
+SOURCE=..\sql\item_geofunc.cpp
# End Source File
# Begin Source File
-SOURCE=.\item_row.cpp
+SOURCE=..\sql\item_row.cpp
# End Source File
# Begin Source File
@@ -227,6 +231,10 @@ SOURCE=.\lib_sql.cpp
# End Source File
# Begin Source File
+SOURCE=..\libmysql\libmysql.c
+# End Source File
+# Begin Source File
+
SOURCE=.\libmysqld.c
# End Source File
# Begin Source File
@@ -287,7 +295,11 @@ SOURCE=..\sql\procedure.cpp
# End Source File
# Begin Source File
-SOURCE=.\protocol.cpp
+SOURCE=..\sql\protocol.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\protocol_cursor.cpp
# End Source File
# Begin Source File
@@ -303,6 +315,26 @@ SOURCE=..\sql\set_var.cpp
# End Source File
# Begin Source File
+SOURCE=..\sql\sp.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sp_cache.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sp_head.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sp_pcontext.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sp_rcontext.cpp
+# End Source File
+# Begin Source File
+
SOURCE=..\sql\spatial.cpp
# End Source File
# Begin Source File
@@ -355,7 +387,7 @@ SOURCE=..\sql\sql_handler.cpp
# End Source File
# Begin Source File
-SOURCE=.\sql_help.cpp
+SOURCE=..\sql\sql_help.cpp
# End Source File
# Begin Source File
@@ -371,6 +403,10 @@ SOURCE=..\sql\sql_list.cpp
# End Source File
# Begin Source File
+SOURCE=..\sql\sql_load.cpp
+# End Source File
+# Begin Source File
+
SOURCE=..\sql\sql_manager.cpp
# End Source File
# Begin Source File
diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp
index b8413a9a7ae..dbf65a11166 100644
--- a/VC++Files/sql/mysqld.dsp
+++ b/VC++Files/sql/mysqld.dsp
@@ -466,21 +466,15 @@ SOURCE=.\item_func.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Debug"
-# ADD CPP /G5 /I "../zlib"
+# ADD CPP /G5
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "mysqld - Win32 nt"
-# ADD CPP /I "../zlib"
-
!ELSEIF "$(CFG)" == "mysqld - Win32 Max nt"
-# ADD CPP /I "../zlib"
-
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-# ADD CPP /I "../zlib"
-
!ENDIF
# End Source File
@@ -789,6 +783,10 @@ SOURCE=.\protocol.cpp
# End Source File
# Begin Source File
+SOURCE=.\protocol_cursor.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\records.cpp
!IF "$(CFG)" == "mysqld - Win32 Release"
@@ -821,6 +819,26 @@ SOURCE=.\slave.cpp
# End Source File
# Begin Source File
+SOURCE=.\sp.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\sp_cache.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\sp_head.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\sp_pcontext.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\sp_rcontext.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\spatial.cpp
# End Source File
# Begin Source File
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index c51a29026c0..746899604fa 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -521,7 +521,6 @@ static void dump_remote_log_entries(const char* logname)
LAST_EVENT_INFO last_event_info;
uint len;
NET* net = &mysql->net;
- int old_format;
Format_description_log_event* description_event;
if (check_master_version(mysql, &description_event))
diff --git a/sql-common/client.c b/sql-common/client.c
index 14b45942e15..176f3a41cde 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -53,7 +53,7 @@
my_bool net_flush(NET *net);
#else /*EMBEDDED_LIBRARY*/
-#define CLI_MYSQL_REAL_CONNECT mysql_real_connect
+#define CLI_MYSQL_REAL_CONNECT STDCALL mysql_real_connect
#endif /*EMBEDDED_LIBRARY*/
#include <my_sys.h>
#include <mysys_err.h>
@@ -1424,7 +1424,7 @@ static MYSQL_METHODS client_methods=
#endif
};
-MYSQL * STDCALL
+MYSQL *
CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
const char *passwd, const char *db,
uint port, const char *unix_socket,ulong client_flag)
diff --git a/sql/filesort.cc b/sql/filesort.cc
index f97126017cc..0991bad9645 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -840,7 +840,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
ha_rows max_rows,org_max_rows;
my_off_t to_start_filepos;
uchar *strpos;
- BUFFPEK *buffpek,**refpek;
+ BUFFPEK *buffpek;
QUEUE queue;
qsort2_cmp cmp;
volatile THD::killed_state *killed= &current_thd->killed;
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 7d28cd10b81..cccea6bcdb5 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2226,7 +2226,6 @@ String *Item_func_timediff::val_str(String *str)
{
longlong seconds;
long microseconds;
- long days;
int l_sign= 1;
TIME l_time1 ,l_time2, l_time3;
@@ -2336,9 +2335,9 @@ longlong Item_func_timestamp_diff::val_int()
int_type == INTERVAL_QUARTER ||
int_type == INTERVAL_MONTH)
{
- uint year, year_tmp;
+ uint year;
uint year_beg, year_end, month_beg, month_end;
- uint diff_days= seconds/86400L;
+ uint diff_days= (uint) (seconds/86400L);
uint diff_months= 0;
uint diff_years= 0;
if (neg == -1)
diff --git a/sql/log_event.cc b/sql/log_event.cc
index dba36d7d42a..0ff521ce650 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -932,7 +932,7 @@ int Query_log_event::write(IO_CACHE* file)
int Query_log_event::write_data(IO_CACHE* file)
{
- char buf[QUERY_HEADER_LEN+1+4+1+8+1+1+catalog_len];
+ uchar buf[QUERY_HEADER_LEN+1+4+1+8+1+1+FN_REFLEN], *start;
if (!query)
return -1;
@@ -985,7 +985,7 @@ int Query_log_event::write_data(IO_CACHE* file)
guarantees that a slightly older slave will be able to parse those he
knows.
*/
- char* start= buf+QUERY_HEADER_LEN;
+ start= buf+QUERY_HEADER_LEN;
if (flags2_inited)
{
*(start++)= Q_FLAGS2_CODE;
@@ -1001,7 +1001,7 @@ int Query_log_event::write_data(IO_CACHE* file)
if (catalog)
{
*(start++)= Q_CATALOG_CODE;
- *(start++)= catalog_len;
+ *(start++)= (uchar) catalog_len;
bmove(start, catalog, catalog_len);
start+= catalog_len;
/*
@@ -1152,15 +1152,21 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
case Q_FLAGS2_CODE:
flags2_inited= 1;
flags2= uint4korr(++pos);
- DBUG_PRINT("info",("In Query_log_event, read flags2=%lu", flags2));
+ DBUG_PRINT("info",("In Query_log_event, read flags2: %lu", flags2));
pos+= 4;
break;
case Q_SQL_MODE_CODE:
+ {
+#ifndef DBUG_OFF
+ char buff[22];
+#endif
sql_mode_inited= 1;
- sql_mode= uint8korr(++pos);
- DBUG_PRINT("info",("In Query_log_event, read sql_mode=%lu", sql_mode));
+ sql_mode= (ulong) uint8korr(++pos); // QQ: Fix when sql_mode is ulonglong
+ DBUG_PRINT("info",("In Query_log_event, read sql_mode: %s",
+ llstr(sql_mode, buff)));
pos+= 8;
break;
+ }
case Q_CATALOG_CODE:
catalog_len= *(++pos);
/*
@@ -1186,7 +1192,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
/* A 2nd variable part; this is common to all versions */
data_len-= start_dup-start; /* cut not-to-be-duplicated head */
- if (!(data_buf = (char*) my_strdup_with_length(start_dup,
+ if (!(data_buf = (char*) my_strdup_with_length((byte*) start_dup,
data_len,
MYF(MY_WME))))
return;
@@ -1368,8 +1374,9 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
all slaves to start ignoring the dirs).
*/
if (sql_mode_inited)
- thd->variables.sql_mode= (thd->variables.sql_mode&MODE_NO_DIR_IN_CREATE)|
- (sql_mode & ~(uint32)MODE_NO_DIR_IN_CREATE);
+ thd->variables.sql_mode=
+ (ulong) ((thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE) |
+ (sql_mode & ~(ulong) MODE_NO_DIR_IN_CREATE));
/*
Sanity check to make sure the master did not get a really bad
@@ -1807,7 +1814,7 @@ Format_description_log_event::Format_description_log_event(const char* buf,
DBUG_PRINT("info", ("common_header_len=%d number_of_event_types=%d",
common_header_len, number_of_event_types));
/* If alloc fails, we'll detect it in is_valid() */
- post_header_len= (uint8*) my_memdup(buf+ST_COMMON_HEADER_LEN_OFFSET+1,
+ post_header_len= (uint8*) my_memdup((byte*)buf+ST_COMMON_HEADER_LEN_OFFSET+1,
number_of_event_types*
sizeof(*post_header_len),
MYF(0));
diff --git a/sql/log_event.h b/sql/log_event.h
index 147a943144b..7f161267add 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -386,7 +386,7 @@ typedef struct st_last_event_info
bool flags2_inited;
uint32 flags2;
bool sql_mode_inited;
- ulonglong sql_mode;
+ ulong sql_mode; /* must be same as THD.variables.sql_mode */
st_last_event_info()
: flags2_inited(0), flags2(0), sql_mode_inited(0), sql_mode(0)
{
@@ -604,7 +604,7 @@ public:
concerned) from here.
*/
- uint32 catalog_len;
+ uint catalog_len; /* <= 255 char */
/*
We want to be able to store a variable number of N-bit status vars:
@@ -642,7 +642,7 @@ public:
uint32 flags2;
/* In connections sql_mode is 32 bits now but will be 64 bits soon */
- ulonglong sql_mode;
+ ulong sql_mode;
#ifndef MYSQL_CLIENT
diff --git a/sql/sp.cc b/sql/sp.cc
index 6143c31176c..3a640cdc08e 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -66,7 +66,6 @@ db_find_routine_aux(THD *thd, int type, char *name, uint namelen,
TABLE *table;
byte key[64+64+1]; // db, name, type
uint keylen;
- int ret;
// Put the key together
memset(key, (int)' ', 64); // QQ Empty db for now
@@ -191,7 +190,7 @@ db_find_routine(THD *thd, int type, char *name, uint namelen, sp_head **sphp)
modified= table->field[MYSQL_PROC_FIELD_MODIFIED]->val_int();
created= table->field[MYSQL_PROC_FIELD_CREATED]->val_int();
- sql_mode= table->field[MYSQL_PROC_FIELD_SQL_MODE]->val_int();
+ sql_mode= (ulong) table->field[MYSQL_PROC_FIELD_SQL_MODE]->val_int();
table->field[MYSQL_PROC_FIELD_COMMENT]->val_str(&str, &str);
@@ -820,7 +819,7 @@ create_string(THD *thd, ulong *lenp,
st_sp_chistics *chistics)
{
char *buf, *ptr;
- ulong buflen, pos;
+ ulong buflen;
buflen= 100 + namelen + paramslen + returnslen + bodylen +
chistics->comment.length;
@@ -840,14 +839,15 @@ create_string(THD *thd, ulong *lenp,
name, params));
}
if (chistics->detistic)
- ptr+= my_sprintf(ptr, (ptr, (char *)" DETERMINISTIC\n"));
+ ptr= strmov(ptr, " DETERMINISTIC\n");
if (chistics->suid == IS_NOT_SUID)
- ptr+= my_sprintf(ptr, (ptr, (char *)" SQL SECURITY INVOKER\n"));
+ ptr= strmov(ptr, " SQL SECURITY INVOKER\n");
if (chistics->comment.length)
- ptr+= my_sprintf(ptr, (ptr, (char *)" COMMENT '%*s'\n",
- chistics->comment.length,
- chistics->comment.str));
- strcpy(ptr, body);
- *lenp= (ptr-buf)+bodylen;
+ {
+ ptr= strmov(strnmov(strmov(ptr, " COMMENT '"),chistics->comment.str,
+ chistics->comment.length),"'\n");
+ }
+ ptr= strmov(ptr, body);
+ *lenp= (ptr-buf);
return buf;
}
diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc
index 4fee49c2d81..657a96ec33d 100644
--- a/sql/sp_cache.cc
+++ b/sql/sp_cache.cc
@@ -120,7 +120,7 @@ static byte *
hash_get_key_for_sp_head(const byte *ptr, uint *plen,
my_bool first)
{
- return ((sp_head*)ptr)->name(plen);
+ return (byte*) ((sp_head*)ptr)->name(plen);
}
static void
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index f6f4b4b8dae..11fa6ab20fa 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -410,7 +410,6 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
DBUG_ENTER("sp_head::execute_procedure");
DBUG_PRINT("info", ("procedure %s", m_name.str));
int ret;
- sp_instr *p;
uint csize = m_pcont->max_framesize();
uint params = m_pcont->params();
uint hmax = m_pcont->handlers();
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index a25cd9ee63e..41502618cda 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -133,8 +133,6 @@ sp_rcontext::pop_cursors(uint count)
LEX *
sp_cursor::pre_open(THD *thd)
{
- int res;
-
if (m_isopen)
{
send_error(thd, ER_SP_CURSOR_ALREADY_OPEN);
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h
index 6526ed58575..5d836998cb1 100644
--- a/sql/sp_rcontext.h
+++ b/sql/sp_rcontext.h
@@ -23,7 +23,7 @@
#endif
struct sp_cond_type;
-struct sp_cursor;
+class sp_cursor;
struct sp_pvar;
#define SP_HANDLER_NONE 0
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index b9051f88fbd..836f8a15e26 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -36,8 +36,8 @@
#endif
#include <mysys_err.h>
-#include <sp_rcontext.h>
-#include <sp_cache.h>
+#include "sp_rcontext.h"
+#include "sp_cache.h"
/*
The following is used to initialise Table_ident with a internal
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 03f952f3ff5..7cf2b44100b 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -507,7 +507,9 @@ bool multi_delete::send_eof()
ha_autocommit_...
*/
if (deleted)
+ {
query_cache_invalidate3(thd, delete_tables, 1);
+ }
/*
Write the SQL statement to the binlog if we deleted
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 88585db34ce..010ebc3b798 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -357,7 +357,9 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
before binlog writing and ha_autocommit_...
*/
if (info.copied || info.deleted)
+ {
query_cache_invalidate3(thd, table_list, 1);
+ }
transactional_table= table->file->has_transactions();
@@ -1465,7 +1467,9 @@ void select_insert::send_error(uint errcode,const char *err)
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
}
if (info.copied || info.deleted)
+ {
query_cache_invalidate3(thd, table, 1);
+ }
ha_rollback_stmt(thd);
DBUG_VOID_RETURN;
}
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 2f4c6b55963..6b4d2f9b659 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -351,7 +351,9 @@ int mysql_update(THD *thd,
This must be before binlog writing and ha_autocommit_...
*/
if (updated)
+ {
query_cache_invalidate3(thd, table_list, 1);
+ }
transactional_table= table->file->has_transactions();
log_delayed= (transactional_table || table->tmp_table);