Commit 292bb8cb authored by unknown's avatar unknown

Merge bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/my/mysql-5.0


sql/sql_class.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
parents 5c1ee928 4f72061f
...@@ -647,3 +647,4 @@ vio/test-ssl ...@@ -647,3 +647,4 @@ vio/test-ssl
vio/test-sslclient vio/test-sslclient
vio/test-sslserver vio/test-sslserver
vio/viotest-ssl vio/viotest-ssl
mysql_priv.h
...@@ -43,7 +43,7 @@ RSC=rc.exe ...@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # 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 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 # SUBTRACT CPP /WX /Fr
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
...@@ -70,7 +70,7 @@ LINK32=xilink6.exe ...@@ -70,7 +70,7 @@ LINK32=xilink6.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # 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 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 # SUBTRACT CPP /Fr
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
...@@ -91,6 +91,10 @@ LINK32=xilink6.exe ...@@ -91,6 +91,10 @@ LINK32=xilink6.exe
# Name "libmysqld - Win32 Debug" # Name "libmysqld - Win32 Debug"
# Begin Source File # Begin Source File
SOURCE=..\libmysql\client.c
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-latin1.c" SOURCE="..\strings\ctype-latin1.c"
# End Source File # End Source File
# Begin Source File # Begin Source File
...@@ -191,11 +195,11 @@ SOURCE=..\sql\item_func.cpp ...@@ -191,11 +195,11 @@ SOURCE=..\sql\item_func.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\item_geofunc.cpp SOURCE=..\sql\item_geofunc.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\item_row.cpp SOURCE=..\sql\item_row.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
...@@ -227,6 +231,10 @@ SOURCE=.\lib_sql.cpp ...@@ -227,6 +231,10 @@ SOURCE=.\lib_sql.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\libmysql\libmysql.c
# End Source File
# Begin Source File
SOURCE=.\libmysqld.c SOURCE=.\libmysqld.c
# End Source File # End Source File
# Begin Source File # Begin Source File
...@@ -287,7 +295,11 @@ SOURCE=..\sql\procedure.cpp ...@@ -287,7 +295,11 @@ SOURCE=..\sql\procedure.cpp
# End Source File # End Source File
# Begin 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 # End Source File
# Begin Source File # Begin Source File
...@@ -303,6 +315,26 @@ SOURCE=..\sql\set_var.cpp ...@@ -303,6 +315,26 @@ SOURCE=..\sql\set_var.cpp
# End Source File # End Source File
# Begin 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 SOURCE=..\sql\spatial.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
...@@ -355,7 +387,7 @@ SOURCE=..\sql\sql_handler.cpp ...@@ -355,7 +387,7 @@ SOURCE=..\sql\sql_handler.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\sql_help.cpp SOURCE=..\sql\sql_help.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
...@@ -371,6 +403,10 @@ SOURCE=..\sql\sql_list.cpp ...@@ -371,6 +403,10 @@ SOURCE=..\sql\sql_list.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\sql\sql_load.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\sql_manager.cpp SOURCE=..\sql\sql_manager.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -466,21 +466,15 @@ SOURCE=.\item_func.cpp ...@@ -466,21 +466,15 @@ SOURCE=.\item_func.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Debug" !ELSEIF "$(CFG)" == "mysqld - Win32 Debug"
# ADD CPP /G5 /I "../zlib" # ADD CPP /G5
# SUBTRACT CPP /YX /Yc /Yu # SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "mysqld - Win32 nt" !ELSEIF "$(CFG)" == "mysqld - Win32 nt"
# ADD CPP /I "../zlib"
!ELSEIF "$(CFG)" == "mysqld - Win32 Max nt" !ELSEIF "$(CFG)" == "mysqld - Win32 Max nt"
# ADD CPP /I "../zlib"
!ELSEIF "$(CFG)" == "mysqld - Win32 Max" !ELSEIF "$(CFG)" == "mysqld - Win32 Max"
# ADD CPP /I "../zlib"
!ENDIF !ENDIF
# End Source File # End Source File
...@@ -789,6 +783,10 @@ SOURCE=.\protocol.cpp ...@@ -789,6 +783,10 @@ SOURCE=.\protocol.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\protocol_cursor.cpp
# End Source File
# Begin Source File
SOURCE=.\records.cpp SOURCE=.\records.cpp
!IF "$(CFG)" == "mysqld - Win32 Release" !IF "$(CFG)" == "mysqld - Win32 Release"
...@@ -821,6 +819,26 @@ SOURCE=.\slave.cpp ...@@ -821,6 +819,26 @@ SOURCE=.\slave.cpp
# End Source File # End Source File
# Begin 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 SOURCE=.\spatial.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -521,7 +521,6 @@ static void dump_remote_log_entries(const char* logname) ...@@ -521,7 +521,6 @@ static void dump_remote_log_entries(const char* logname)
LAST_EVENT_INFO last_event_info; LAST_EVENT_INFO last_event_info;
uint len; uint len;
NET* net = &mysql->net; NET* net = &mysql->net;
int old_format;
Format_description_log_event* description_event; Format_description_log_event* description_event;
if (check_master_version(mysql, &description_event)) if (check_master_version(mysql, &description_event))
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
my_bool net_flush(NET *net); my_bool net_flush(NET *net);
#else /*EMBEDDED_LIBRARY*/ #else /*EMBEDDED_LIBRARY*/
#define CLI_MYSQL_REAL_CONNECT mysql_real_connect #define CLI_MYSQL_REAL_CONNECT STDCALL mysql_real_connect
#endif /*EMBEDDED_LIBRARY*/ #endif /*EMBEDDED_LIBRARY*/
#include <my_sys.h> #include <my_sys.h>
#include <mysys_err.h> #include <mysys_err.h>
...@@ -1424,7 +1424,7 @@ static MYSQL_METHODS client_methods= ...@@ -1424,7 +1424,7 @@ static MYSQL_METHODS client_methods=
#endif #endif
}; };
MYSQL * STDCALL MYSQL *
CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
const char *passwd, const char *db, const char *passwd, const char *db,
uint port, const char *unix_socket,ulong client_flag) uint port, const char *unix_socket,ulong client_flag)
......
...@@ -840,7 +840,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file, ...@@ -840,7 +840,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
ha_rows max_rows,org_max_rows; ha_rows max_rows,org_max_rows;
my_off_t to_start_filepos; my_off_t to_start_filepos;
uchar *strpos; uchar *strpos;
BUFFPEK *buffpek,**refpek; BUFFPEK *buffpek;
QUEUE queue; QUEUE queue;
qsort2_cmp cmp; qsort2_cmp cmp;
volatile THD::killed_state *killed= &current_thd->killed; volatile THD::killed_state *killed= &current_thd->killed;
......
...@@ -2226,7 +2226,6 @@ String *Item_func_timediff::val_str(String *str) ...@@ -2226,7 +2226,6 @@ String *Item_func_timediff::val_str(String *str)
{ {
longlong seconds; longlong seconds;
long microseconds; long microseconds;
long days;
int l_sign= 1; int l_sign= 1;
TIME l_time1 ,l_time2, l_time3; TIME l_time1 ,l_time2, l_time3;
...@@ -2336,9 +2335,9 @@ longlong Item_func_timestamp_diff::val_int() ...@@ -2336,9 +2335,9 @@ longlong Item_func_timestamp_diff::val_int()
int_type == INTERVAL_QUARTER || int_type == INTERVAL_QUARTER ||
int_type == INTERVAL_MONTH) int_type == INTERVAL_MONTH)
{ {
uint year, year_tmp; uint year;
uint year_beg, year_end, month_beg, month_end; 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_months= 0;
uint diff_years= 0; uint diff_years= 0;
if (neg == -1) if (neg == -1)
......
...@@ -932,7 +932,7 @@ int Query_log_event::write(IO_CACHE* file) ...@@ -932,7 +932,7 @@ int Query_log_event::write(IO_CACHE* file)
int Query_log_event::write_data(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) if (!query)
return -1; return -1;
...@@ -985,7 +985,7 @@ int Query_log_event::write_data(IO_CACHE* file) ...@@ -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 guarantees that a slightly older slave will be able to parse those he
knows. knows.
*/ */
char* start= buf+QUERY_HEADER_LEN; start= buf+QUERY_HEADER_LEN;
if (flags2_inited) if (flags2_inited)
{ {
*(start++)= Q_FLAGS2_CODE; *(start++)= Q_FLAGS2_CODE;
...@@ -1001,7 +1001,7 @@ int Query_log_event::write_data(IO_CACHE* file) ...@@ -1001,7 +1001,7 @@ int Query_log_event::write_data(IO_CACHE* file)
if (catalog) if (catalog)
{ {
*(start++)= Q_CATALOG_CODE; *(start++)= Q_CATALOG_CODE;
*(start++)= catalog_len; *(start++)= (uchar) catalog_len;
bmove(start, catalog, catalog_len); bmove(start, catalog, catalog_len);
start+= catalog_len; start+= catalog_len;
/* /*
...@@ -1152,15 +1152,21 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, ...@@ -1152,15 +1152,21 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
case Q_FLAGS2_CODE: case Q_FLAGS2_CODE:
flags2_inited= 1; flags2_inited= 1;
flags2= uint4korr(++pos); 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; pos+= 4;
break; break;
case Q_SQL_MODE_CODE: case Q_SQL_MODE_CODE:
{
#ifndef DBUG_OFF
char buff[22];
#endif
sql_mode_inited= 1; sql_mode_inited= 1;
sql_mode= uint8korr(++pos); sql_mode= (ulong) uint8korr(++pos); // QQ: Fix when sql_mode is ulonglong
DBUG_PRINT("info",("In Query_log_event, read sql_mode=%lu", sql_mode)); DBUG_PRINT("info",("In Query_log_event, read sql_mode: %s",
llstr(sql_mode, buff)));
pos+= 8; pos+= 8;
break; break;
}
case Q_CATALOG_CODE: case Q_CATALOG_CODE:
catalog_len= *(++pos); catalog_len= *(++pos);
/* /*
...@@ -1186,7 +1192,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, ...@@ -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 */ /* A 2nd variable part; this is common to all versions */
data_len-= start_dup-start; /* cut not-to-be-duplicated head */ 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, data_len,
MYF(MY_WME)))) MYF(MY_WME))))
return; return;
...@@ -1368,8 +1374,9 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) ...@@ -1368,8 +1374,9 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
all slaves to start ignoring the dirs). all slaves to start ignoring the dirs).
*/ */
if (sql_mode_inited) if (sql_mode_inited)
thd->variables.sql_mode= (thd->variables.sql_mode&MODE_NO_DIR_IN_CREATE)| thd->variables.sql_mode=
(sql_mode & ~(uint32)MODE_NO_DIR_IN_CREATE); (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 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, ...@@ -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", DBUG_PRINT("info", ("common_header_len=%d number_of_event_types=%d",
common_header_len, number_of_event_types)); common_header_len, number_of_event_types));
/* If alloc fails, we'll detect it in is_valid() */ /* 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* number_of_event_types*
sizeof(*post_header_len), sizeof(*post_header_len),
MYF(0)); MYF(0));
......
...@@ -386,7 +386,7 @@ typedef struct st_last_event_info ...@@ -386,7 +386,7 @@ typedef struct st_last_event_info
bool flags2_inited; bool flags2_inited;
uint32 flags2; uint32 flags2;
bool sql_mode_inited; bool sql_mode_inited;
ulonglong sql_mode; ulong sql_mode; /* must be same as THD.variables.sql_mode */
st_last_event_info() st_last_event_info()
: flags2_inited(0), flags2(0), sql_mode_inited(0), sql_mode(0) : flags2_inited(0), flags2(0), sql_mode_inited(0), sql_mode(0)
{ {
...@@ -604,7 +604,7 @@ class Query_log_event: public Log_event ...@@ -604,7 +604,7 @@ class Query_log_event: public Log_event
concerned) from here. 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: We want to be able to store a variable number of N-bit status vars:
...@@ -642,7 +642,7 @@ class Query_log_event: public Log_event ...@@ -642,7 +642,7 @@ class Query_log_event: public Log_event
uint32 flags2; uint32 flags2;
/* In connections sql_mode is 32 bits now but will be 64 bits soon */ /* In connections sql_mode is 32 bits now but will be 64 bits soon */
ulonglong sql_mode; ulong sql_mode;
#ifndef MYSQL_CLIENT #ifndef MYSQL_CLIENT
......
...@@ -66,7 +66,6 @@ db_find_routine_aux(THD *thd, int type, char *name, uint namelen, ...@@ -66,7 +66,6 @@ db_find_routine_aux(THD *thd, int type, char *name, uint namelen,
TABLE *table; TABLE *table;
byte key[64+64+1]; // db, name, type byte key[64+64+1]; // db, name, type
uint keylen; uint keylen;
int ret;
// Put the key together // Put the key together
memset(key, (int)' ', 64); // QQ Empty db for now 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) ...@@ -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(); modified= table->field[MYSQL_PROC_FIELD_MODIFIED]->val_int();
created= table->field[MYSQL_PROC_FIELD_CREATED]->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); table->field[MYSQL_PROC_FIELD_COMMENT]->val_str(&str, &str);
...@@ -820,7 +819,7 @@ create_string(THD *thd, ulong *lenp, ...@@ -820,7 +819,7 @@ create_string(THD *thd, ulong *lenp,
st_sp_chistics *chistics) st_sp_chistics *chistics)
{ {
char *buf, *ptr; char *buf, *ptr;
ulong buflen, pos; ulong buflen;
buflen= 100 + namelen + paramslen + returnslen + bodylen + buflen= 100 + namelen + paramslen + returnslen + bodylen +
chistics->comment.length; chistics->comment.length;
...@@ -840,14 +839,15 @@ create_string(THD *thd, ulong *lenp, ...@@ -840,14 +839,15 @@ create_string(THD *thd, ulong *lenp,
name, params)); name, params));
} }
if (chistics->detistic) if (chistics->detistic)
ptr+= my_sprintf(ptr, (ptr, (char *)" DETERMINISTIC\n")); ptr= strmov(ptr, " DETERMINISTIC\n");
if (chistics->suid == IS_NOT_SUID) 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) if (chistics->comment.length)
ptr+= my_sprintf(ptr, (ptr, (char *)" COMMENT '%*s'\n", {
chistics->comment.length, ptr= strmov(strnmov(strmov(ptr, " COMMENT '"),chistics->comment.str,
chistics->comment.str)); chistics->comment.length),"'\n");
strcpy(ptr, body); }
*lenp= (ptr-buf)+bodylen; ptr= strmov(ptr, body);
*lenp= (ptr-buf);
return buf; return buf;
} }
...@@ -120,7 +120,7 @@ static byte * ...@@ -120,7 +120,7 @@ static byte *
hash_get_key_for_sp_head(const byte *ptr, uint *plen, hash_get_key_for_sp_head(const byte *ptr, uint *plen,
my_bool first) my_bool first)
{ {
return ((sp_head*)ptr)->name(plen); return (byte*) ((sp_head*)ptr)->name(plen);
} }
static void static void
......
...@@ -410,7 +410,6 @@ sp_head::execute_procedure(THD *thd, List<Item> *args) ...@@ -410,7 +410,6 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
DBUG_ENTER("sp_head::execute_procedure"); DBUG_ENTER("sp_head::execute_procedure");
DBUG_PRINT("info", ("procedure %s", m_name.str)); DBUG_PRINT("info", ("procedure %s", m_name.str));
int ret; int ret;
sp_instr *p;
uint csize = m_pcont->max_framesize(); uint csize = m_pcont->max_framesize();
uint params = m_pcont->params(); uint params = m_pcont->params();
uint hmax = m_pcont->handlers(); uint hmax = m_pcont->handlers();
......
...@@ -133,8 +133,6 @@ sp_rcontext::pop_cursors(uint count) ...@@ -133,8 +133,6 @@ sp_rcontext::pop_cursors(uint count)
LEX * LEX *
sp_cursor::pre_open(THD *thd) sp_cursor::pre_open(THD *thd)
{ {
int res;
if (m_isopen) if (m_isopen)
{ {
send_error(thd, ER_SP_CURSOR_ALREADY_OPEN); send_error(thd, ER_SP_CURSOR_ALREADY_OPEN);
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#endif #endif
struct sp_cond_type; struct sp_cond_type;
struct sp_cursor; class sp_cursor;
struct sp_pvar; struct sp_pvar;
#define SP_HANDLER_NONE 0 #define SP_HANDLER_NONE 0
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
#endif #endif
#include <mysys_err.h> #include <mysys_err.h>
#include <sp_rcontext.h> #include "sp_rcontext.h"
#include <sp_cache.h> #include "sp_cache.h"
/* /*
The following is used to initialise Table_ident with a internal The following is used to initialise Table_ident with a internal
......
...@@ -507,7 +507,9 @@ bool multi_delete::send_eof() ...@@ -507,7 +507,9 @@ bool multi_delete::send_eof()
ha_autocommit_... ha_autocommit_...
*/ */
if (deleted) if (deleted)
{
query_cache_invalidate3(thd, delete_tables, 1); query_cache_invalidate3(thd, delete_tables, 1);
}
/* /*
Write the SQL statement to the binlog if we deleted Write the SQL statement to the binlog if we deleted
......
...@@ -357,7 +357,9 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, ...@@ -357,7 +357,9 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
before binlog writing and ha_autocommit_... before binlog writing and ha_autocommit_...
*/ */
if (info.copied || info.deleted) if (info.copied || info.deleted)
{
query_cache_invalidate3(thd, table_list, 1); query_cache_invalidate3(thd, table_list, 1);
}
transactional_table= table->file->has_transactions(); transactional_table= table->file->has_transactions();
...@@ -1465,7 +1467,9 @@ void select_insert::send_error(uint errcode,const char *err) ...@@ -1465,7 +1467,9 @@ void select_insert::send_error(uint errcode,const char *err)
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
} }
if (info.copied || info.deleted) if (info.copied || info.deleted)
{
query_cache_invalidate3(thd, table, 1); query_cache_invalidate3(thd, table, 1);
}
ha_rollback_stmt(thd); ha_rollback_stmt(thd);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
...@@ -351,7 +351,9 @@ int mysql_update(THD *thd, ...@@ -351,7 +351,9 @@ int mysql_update(THD *thd,
This must be before binlog writing and ha_autocommit_... This must be before binlog writing and ha_autocommit_...
*/ */
if (updated) if (updated)
{
query_cache_invalidate3(thd, table_list, 1); query_cache_invalidate3(thd, table_list, 1);
}
transactional_table= table->file->has_transactions(); transactional_table= table->file->has_transactions();
log_delayed= (transactional_table || table->tmp_table); log_delayed= (transactional_table || table->tmp_table);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment