diff options
author | unknown <monty@mysql.com> | 2003-12-21 02:07:45 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2003-12-21 02:07:45 +0200 |
commit | 4f72061f4095e5c9b5823f998b58302eef19382a (patch) | |
tree | b4b50b6b03398c2d68a97d79f6b2d07eb470327e /sql | |
parent | e622f6fb0bdf48c7fff4d0819a276f0f6418e0ab (diff) | |
download | mariadb-git-4f72061f4095e5c9b5823f998b58302eef19382a.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
Diffstat (limited to 'sql')
-rw-r--r-- | sql/filesort.cc | 2 | ||||
-rw-r--r-- | sql/item_timefunc.cc | 5 | ||||
-rw-r--r-- | sql/log_event.cc | 27 | ||||
-rw-r--r-- | sql/log_event.h | 6 | ||||
-rw-r--r-- | sql/sp.cc | 20 | ||||
-rw-r--r-- | sql/sp_cache.cc | 2 | ||||
-rw-r--r-- | sql/sp_head.cc | 1 | ||||
-rw-r--r-- | sql/sp_rcontext.cc | 2 | ||||
-rw-r--r-- | sql/sp_rcontext.h | 2 | ||||
-rw-r--r-- | sql/sql_class.cc | 4 | ||||
-rw-r--r-- | sql/sql_delete.cc | 2 | ||||
-rw-r--r-- | sql/sql_insert.cc | 4 | ||||
-rw-r--r-- | sql/sql_update.cc | 2 |
13 files changed, 45 insertions, 34 deletions
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= ¤t_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); |