From 6c4aa883ce15b6b5193d34caf72025548da56175 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Oct 2006 17:19:02 +0500 Subject: Bug #23427 (incompatible ABI change) the incompatibility was caused by current_stmt member added to the MYSQL structure. It's possible to move it to THD structure instead which saves ABI include/mysql.h: member moved to the THD structure libmysqld/lib_sql.cc: now we use THD member here sql/sql_class.h: current_stmt member added for the embedded server --- include/mysql.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include') diff --git a/include/mysql.h b/include/mysql.h index 143f6752c46..89e861864df 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -270,12 +270,6 @@ typedef struct st_mysql from mysql_stmt_close if close had to cancel result set of this object. */ my_bool *unbuffered_fetch_owner; - /* - In embedded server it points to the statement that is processed - in the current query. We store some results directly in statement - fields then. - */ - struct st_mysql_stmt *current_stmt; } MYSQL; typedef struct st_mysql_res { -- cgit v1.2.1 From e463ee942152e22c77d52403dbfb772648d4f35d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 30 Oct 2006 14:40:15 +0400 Subject: Bug#20404: SHOW CREATE TABLE fails with Turkish I Problem: SHOW CREATE TABLE printed garbage in table name for tables having TURKISH I (i.e. LATIN CAPITABLE LETTER I WITH DOT ABOVE) when lower-case-table-name=1. Reason: In some cases during lower/upper conversion in utf8, the result string can be shorter the original string (including the above letter). Old implementation of caseup_str() and casedn_str() didn't handle the result length properly, assuming that length cannot change. This fix changes the result type of cs->cset->casedn_str() and cs->cset->caseup_str() from VOID to UINT, to return the result length, as well as put '\0' terminator on a proper place. Also, my_caseup_str_utf8() and my_casedn_str_utf8() were rewritten not to use strlen() for performance purposes. It was done with help of adding of new functions - my_utf8_uni_no_range() and my_uni_utf8_no_range() - for null terminated strings. include/m_ctype.h: Changeing return type from void to int for caseup_str() and casedn_str() mysql-test/r/lowercase_table.result: Adding test case mysql-test/t/lowercase_table.test: Adding test case sql/sql_parse.cc: Set table->table.length to result of my_casedn_str(). strings/ctype-bin.c: Changeing return type from void to int for caseup_str() and casedn_str() strings/ctype-mb.c: Changeing return type from void to int for caseup_str() and casedn_str() strings/ctype-simple.c: Changeing return type from void to int for caseup_str() and casedn_str() strings/ctype-ucs2.c: Changeing return type from void to int for caseup_str() and casedn_str() strings/ctype-utf8.c: Changeing return type from void to int for caseup_str() and casedn_str(). Optimization, to get rid of strlen(): Adding my_utf8_uni_no_range() and my_uni_utf8_no_range() - for null terninated strings. --- include/m_ctype.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/m_ctype.h b/include/m_ctype.h index 35d2889bdd5..ffecadd9836 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -178,8 +178,8 @@ typedef struct my_charset_handler_st unsigned char *s,unsigned char *e); /* Functions for case and sort convertion */ - void (*caseup_str)(struct charset_info_st *, char *); - void (*casedn_str)(struct charset_info_st *, char *); + uint (*caseup_str)(struct charset_info_st *, char *); + uint (*casedn_str)(struct charset_info_st *, char *); uint (*caseup)(struct charset_info_st *, char *src, uint srclen, char *dst, uint dstlen); uint (*casedn)(struct charset_info_st *, char *src, uint srclen, @@ -311,8 +311,8 @@ extern uint my_instr_simple(struct charset_info_st *, /* Functions for 8bit */ -extern void my_caseup_str_8bit(CHARSET_INFO *, char *); -extern void my_casedn_str_8bit(CHARSET_INFO *, char *); +extern uint my_caseup_str_8bit(CHARSET_INFO *, char *); +extern uint my_casedn_str_8bit(CHARSET_INFO *, char *); extern uint my_caseup_8bit(CHARSET_INFO *, char *src, uint srclen, char *dst, uint dstlen); extern uint my_casedn_8bit(CHARSET_INFO *, char *src, uint srclen, @@ -399,8 +399,8 @@ int my_mbcharlen_8bit(CHARSET_INFO *, uint c); /* Functions for multibyte charsets */ -extern void my_caseup_str_mb(CHARSET_INFO *, char *); -extern void my_casedn_str_mb(CHARSET_INFO *, char *); +extern uint my_caseup_str_mb(CHARSET_INFO *, char *); +extern uint my_casedn_str_mb(CHARSET_INFO *, char *); extern uint my_caseup_mb(CHARSET_INFO *, char *src, uint srclen, char *dst, uint dstlen); extern uint my_casedn_mb(CHARSET_INFO *, char *src, uint srclen, -- cgit v1.2.1 From 030d080d8b4eb8154aa4da13b28c5b81cba09b03 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Nov 2006 22:33:18 +0400 Subject: bug #19491 (5.0-related additional fixes) include/my_time.h: we need to use it outside the my_time.cc mysql-test/r/gis-rtree.result: result fixed sql-common/my_time.c: 'static' removed sql/field.cc: checks for invalid datetimes added --- include/my_time.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/my_time.h b/include/my_time.h index e52ef69475d..17cc10a0221 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -49,6 +49,8 @@ typedef long my_time_t; #define TIME_NO_ZERO_DATE (TIME_NO_ZERO_IN_DATE*2) #define TIME_INVALID_DATES (TIME_NO_ZERO_DATE*2) +my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, + ulong flags, int *was_cut); enum enum_mysql_timestamp_type str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, uint flags, int *was_cut); -- cgit v1.2.1 From 81d3eb54407d65c06f80c2dfe38e5be3ceb1d40a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Nov 2006 17:21:59 -0800 Subject: This patch fixes the example engine, the example parser, and the example daemon to compile. AKA You can now test that the interface is actually working :) configure.in: Removed unneeded call to old plugin syntax. include/mysql/plugin.h: Updates for daemon type (and fixed warning on declare end). plugin/fulltext/Makefile.am: Updated names so that we can install and test it. plugin/fulltext/plugin_example.c: Fixed wrong call. sql/mysqld.cc: Removed old have_example (we don't need it any longer). sql/set_var.cc: Removed old have_example sql/sql_plugin.cc: Added support for DAEMON type (just an internal raw plugin) storage/example/plug.in: Removed example static build so that we can test dynamic engines plugin/daemon_example/AUTHORS: New BitKeeper file ``plugin/daemon_example/AUTHORS'' plugin/daemon_example/ChangeLog: New BitKeeper file ``plugin/daemon_example/ChangeLog'' plugin/daemon_example/Makefile.am: New BitKeeper file ``plugin/daemon_example/Makefile.am'' plugin/daemon_example/NEWS: New BitKeeper file ``plugin/daemon_example/NEWS'' plugin/daemon_example/README: New BitKeeper file ``plugin/daemon_example/README'' plugin/daemon_example/configure.in: New BitKeeper file ``plugin/daemon_example/configure.in'' plugin/daemon_example/daemon_example.c: New BitKeeper file ``plugin/daemon_example/daemon_example.c'' plugin/daemon_example/plug.in: New BitKeeper file ``plugin/daemon_example/plug.in'' plugin/fulltext/plug.in: Added plug.in file so that we compile fulltext example! --- include/mysql/plugin.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index 22cd64a52c4..1385bb502bb 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -29,7 +29,8 @@ #define MYSQL_UDF_PLUGIN 0 /* User-defined function */ #define MYSQL_STORAGE_ENGINE_PLUGIN 1 /* Storage Engine */ #define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */ -#define MYSQL_MAX_PLUGIN_TYPE_NUM 3 /* The number of plugin types */ +#define MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */ +#define MYSQL_MAX_PLUGIN_TYPE_NUM 4 /* The number of plugin types */ /* We use the following strings to define licenses for plugins */ #define PLUGIN_LICENSE_PROPRIETARY 0 @@ -65,7 +66,7 @@ __MYSQL_DECLARE_PLUGIN(NAME, \ builtin_ ## NAME ## _sizeof_struct_st_plugin, \ builtin_ ## NAME ## _plugin) -#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0}} +#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0}} /* declarations for SHOW STATUS support in plugins @@ -295,6 +296,13 @@ struct st_mysql_ftparser int (*deinit)(MYSQL_FTPARSER_PARAM *param); }; +/************************************************************************* + API for Storage Engine plugin. (MYSQL_DAEMON_PLUGIN) +*/ + +/* handlertons of different MySQL releases are incompatible */ +#define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) + /************************************************************************* API for Storage Engine plugin. (MYSQL_STORAGE_ENGINE_PLUGIN) */ @@ -313,5 +321,15 @@ struct st_mysql_storage_engine int interface_version; }; +/* + Here we define only the descriptor structure, that is referred from + st_mysql_plugin. +*/ + +struct st_mysql_daemon +{ + int interface_version; +}; + #endif -- cgit v1.2.1 From 4f096746752091b5da2c58994859852e24e0451b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Nov 2006 17:14:43 +0300 Subject: Make IM compiled on Win32: add pthread_join() impl. include/my_pthread.h: Add pthread_join() for Windows. --- include/my_pthread.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/my_pthread.h b/include/my_pthread.h index 0cb38d29be8..8a0e1fc2b01 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -130,6 +130,9 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/ #define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B)) #define pthread_kill(A,B) pthread_dummy(0) +#define pthread_join(A,B) \ + ((WaitForSingleObject((A), INFINITE) != WAIT_OBJECT_0) || !CloseHandle(A)) + /* Dummy defines for easier code */ #define pthread_attr_setdetachstate(A,B) pthread_dummy(0) #define my_pthread_attr_setprio(A,B) pthread_attr_setprio(A,B) -- cgit v1.2.1 From 467210304ada38e7d887eb20586186f1d3785490 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 23 Nov 2006 12:06:04 +0100 Subject: Add define for my_getpagesize to 8192(reworked in 5.0) --- include/my_sys.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/my_sys.h b/include/my_sys.h index ebb518314b2..65bfb0b7e6a 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -863,7 +863,12 @@ my_bool my_gethwaddr(uchar *to); #define HAVE_MMAP #endif +#ifndef __NETWARE__ int my_getpagesize(void); +#else +#define my_getpagesize() 8192 +#endif + void *my_mmap(void *, size_t, int, int, int, my_off_t); int my_munmap(void *, size_t); #endif -- cgit v1.2.1 From 42f6fd5f547324c3e714c76fbe5ec92cfad4043e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 23 Nov 2006 16:41:21 +0200 Subject: Added some missing DBUG_RETURN Fixed that --valgrind works again with mysql-test-run.sh Extended error messages when loosing connection during mysql_real_connect() client/mysqldump.c: Added some missing DBUG_RETURN include/errmsg.h: Extended error messages when loosing connection during mysql_real_connect() libmysql/errmsg.c: Extended error messages when loosing connection during mysql_real_connect() mysql-test/mysql-test-run.pl: Don't remove .reject files at startup mysql-test/mysql-test-run.sh: Fixed that --valgrind works again Don't give warnings for directores in var/tmp sql-common/client.c: Extended error messages when loosing connection during mysql_real_connect() --- include/errmsg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/errmsg.h b/include/errmsg.h index 1dd5759c104..aca7c4b6a1f 100644 --- a/include/errmsg.h +++ b/include/errmsg.h @@ -97,6 +97,7 @@ extern const char *client_errors[]; /* Error messages */ #define CR_NO_STMT_METADATA 2052 #define CR_NO_RESULT_SET 2053 #define CR_NOT_IMPLEMENTED 2054 -#define CR_ERROR_LAST /*Copy last error nr:*/ 2054 +#define CR_SERVER_LOST_EXTENDED 2055 +#define CR_ERROR_LAST /*Copy last error nr:*/ 2055 /* Add error numbers before CR_ERROR_LAST and change it accordingly. */ -- cgit v1.2.1 From c1477a3f20897905f3835c4377c9e88841fdd4bb Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Nov 2006 18:16:08 +0200 Subject: Removed compiler warnings Ensure that my_size_t is always unsigned (to get predictiable results from system to system) Removed some %lld, as these are not portable BUILD/FINISH.sh: Remove configure files from storage engines (as some of them may be old versions and may cause conflicts) client/mysqldump.c: Removed compiler warning client/mysqlslap.c: Removed compiler warning client/mysqltest.c: Removed compiler warning cmd-line-utils/readline/bind.c: Removed compiler warning cmd-line-utils/readline/histfile.c: Removed compiler warning include/my_global.h: Ensure that my_size_t is always unsigned (to get predictiable results from system to system) Moved my_offset_t here from parse_file.h sql/event_data_objects.cc: Removed compiler warning sql/event_scheduler.cc: Removed compiler warning sql/field.h: Removed compiler warning sql/ha_ndbcluster_binlog.cc: Removed compiler warning sql/ha_partition.cc: Removed compiler warning sql/item_strfunc.cc: Removed compiler warning sql/log_event.cc: Removed compiler warning sql/mysqld.cc: Removed compiler warning sql/parse_file.h: Moved my_offset_t to my_global.h sql/rpl_utility.cc: Removed compiler warning sql/sql_binlog.cc: Removed compiler warning sql/sql_cache.cc: Removed compiler warning sql/tztime.cc: Removed compiler warning storage/archive/ha_archive.cc: Removed compiler warning Removed %lld as it's not portable storage/heap/hp_write.c: Removed compiler warning storage/innobase/os/os0file.c: Removed compiler warning storage/myisam/myisampack.c: Removed compiler warning storage/myisammrg/myrg_rkey.c: Removed compiler warning storage/ndb/include/kernel/signaldata/DictTabInfo.hpp: Use my_offsetof instead of offsetof to get rid of compiler warnings storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp: Removed compiler warning storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp: Removed compiler warning Note: Someone from NDB team should check this fix! storage/ndb/src/kernel/vm/Rope.cpp: Removed compiler warning storage/ndb/src/mgmapi/mgmapi.cpp: Removed compiler warning storage/ndb/src/ndbapi/Ndb.cpp: Removed compiler warning storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp: Removed compiler warning storage/ndb/src/ndbapi/NdbScanOperation.cpp: Removed compiler warning storage/ndb/src/ndbapi/NdbTransaction.cpp: Removed compiler warning storage/ndb/src/ndbapi/Ndblist.cpp: Removed compiler warning --- include/my_global.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/my_global.h b/include/my_global.h index a7ec41068b3..c182ef7b799 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -869,9 +869,8 @@ typedef long my_ptrdiff_t; typedef long long my_ptrdiff_t; #endif -#if HAVE_SIZE_T -typedef size_t my_size_t; -#elif SIZEOF_CHARP <= SIZEOF_LONG +/* We can't set my_size_t to size_t as we want my_size_t to be unsigned */ +#if SIZEOF_CHARP <= SIZEOF_LONG typedef unsigned long my_size_t; #else typedef unsigned long long my_size_t; @@ -886,6 +885,22 @@ typedef unsigned long long my_size_t; #define ADD_TO_PTR(ptr,size,type) (type) ((byte*) (ptr)+size) #define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((byte*) (A) - (byte*) (B)) +/* + Custom version of standard offsetof() macro which can be used to get + offsets of members in class for non-POD types (according to the current + version of C++ standard offsetof() macro can't be used in such cases and + attempt to do so causes warnings to be emitted, OTOH in many cases it is + still OK to assume that all instances of the class has the same offsets + for the same members). + + This is temporary solution which should be removed once File_parser class + and related routines are refactored. +*/ + +#define my_offsetof(TYPE, MEMBER) \ + ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10)) + + #define NullS (char *) 0 /* Nowdays we do not support MessyDos */ #ifndef NEAR -- cgit v1.2.1