From 2a664ff6c200a7bfe5feee7aec7b1650dab8ccff Mon Sep 17 00:00:00 2001 From: "bar@mysql.com/bar.intranet.mysql.r18.ru" <> Date: Thu, 20 Jul 2006 15:52:48 +0500 Subject: Bug#20471 LIKE search fails with indexed utf8 char column The main problem was already fixed by Igor under terms of 16674. Adding some additional minor fixes and tests. --- include/m_ctype.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/m_ctype.h b/include/m_ctype.h index cd1dac9dde8..b9ed39414bb 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -108,6 +108,8 @@ enum my_lex_states struct charset_info_st; + +/* See strings/CHARSET_INFO.txt about information on this structure */ typedef struct my_collation_handler_st { my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint)); @@ -147,6 +149,7 @@ extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler; extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler; +/* See strings/CHARSET_INFO.txt about information on this structure */ typedef struct my_charset_handler_st { my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint)); @@ -204,6 +207,7 @@ extern MY_CHARSET_HANDLER my_charset_8bit_handler; extern MY_CHARSET_HANDLER my_charset_ucs2_handler; +/* See strings/CHARSET_INFO.txt about information on this structure */ typedef struct charset_info_st { uint number; -- cgit v1.2.1 From 72af9c2fef8069a9dd289dea7d6a46eea2fd71a5 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com/bar.intranet.mysql.r18.ru" <> Date: Thu, 14 Sep 2006 10:05:07 +0500 Subject: Better comment text (thanks to SergeyP for suggestions made for the b#20471 patch) --- include/m_ctype.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/m_ctype.h b/include/m_ctype.h index b9ed39414bb..09ebc781c8d 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -109,7 +109,7 @@ enum my_lex_states struct charset_info_st; -/* See strings/CHARSET_INFO.txt about information on this structure */ +/* See strings/CHARSET_INFO.txt for information about this structure */ typedef struct my_collation_handler_st { my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint)); -- cgit v1.2.1 From 5f08a831863c28561b6b99f8f8246a3a24b2f2c2 Mon Sep 17 00:00:00 2001 From: "istruewing@chilla.local" <> Date: Mon, 9 Oct 2006 19:26:55 +0200 Subject: Bug#8283 - OPTIMIZE TABLE causes data loss OPTIMIZE TABLE with myisam_repair_threads > 1 performs a non-quick parallel repair. This means that it does not only rebuild all indexes, but also the data file. Non-quick parallel repair works so that there is one thread per index. The first of the threads rebuilds also the new data file. The problem was that all threads shared the read io cache on the old data file. If there were holes (deleted records) in the table, the first thread skipped them, writing only contiguous, non-deleted records to the new data file. Then it built the new index so that its entries pointed to the correct record positions. But the other threads didn't know the new record positions, but put the positions from the old data file into the index. The new design is so that there is a shared io cache which is filled by the first thread (the data file writer) with the new contiguous records and read by the other threads. Now they know the new record positions. Another problem was that for the parallel repair of compressed tables a common bit_buff and rec_buff was used. I changed it so that thread specific buffers are used for parallel repair. A similar problem existed for checksum calculation. I made this multi-thread safe too. --- include/my_sys.h | 22 ++++++++++++++-------- include/myisam.h | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/my_sys.h b/include/my_sys.h index 02ea188a18e..92f3758a846 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -325,12 +325,18 @@ typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*); #ifdef THREAD typedef struct st_io_cache_share { - /* to sync on reads into buffer */ - pthread_mutex_t mutex; - pthread_cond_t cond; - int count, total; - /* actual IO_CACHE that filled the buffer */ - struct st_io_cache *active; + pthread_mutex_t mutex; /* To sync on reads into buffer. */ + pthread_cond_t cond; /* To wait for signals. */ + pthread_cond_t cond_writer; /* For a synchronized writer. */ + /* Offset in file corresponding to the first byte of buffer. */ + my_off_t pos_in_file; + /* If a synchronized write cache is the source of the data. */ + struct st_io_cache *source_cache; + byte *buffer; /* The read buffer. */ + byte *read_end; /* Behind last valid byte of buffer. */ + int running_threads; /* threads not in lock. */ + int total_threads; /* threads sharing the cache. */ + int error; /* Last error. */ #ifdef NOT_YET_IMPLEMENTED /* whether the structure should be free'd */ my_bool alloced; @@ -672,8 +678,8 @@ extern void setup_io_cache(IO_CACHE* info); extern int _my_b_read(IO_CACHE *info,byte *Buffer,uint Count); #ifdef THREAD extern int _my_b_read_r(IO_CACHE *info,byte *Buffer,uint Count); -extern void init_io_cache_share(IO_CACHE *info, - IO_CACHE_SHARE *s, uint num_threads); +extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, + IO_CACHE *write_cache, uint num_threads); extern void remove_io_thread(IO_CACHE *info); #endif extern int _my_b_seq_read(IO_CACHE *info,byte *Buffer,uint Count); diff --git a/include/myisam.h b/include/myisam.h index c2d3d99a414..0a808070748 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -345,7 +345,7 @@ typedef struct st_mi_check_param uint testflag, key_cache_block_size; uint8 language; my_bool using_global_keycache, opt_lock_memory, opt_follow_links; - my_bool retry_repair, force_sort, calc_checksum; + my_bool retry_repair, force_sort; char temp_filename[FN_REFLEN],*isam_file_name; MY_TMPDIR *tmpdir; int tmpfile_createflag; -- cgit v1.2.1 From 8a7413f704c49b60509975bef5204d7c9b55e3d3 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/c-584072d5.010-2112-6f72651.cust.bredbandsbolaget.se" <> Date: Thu, 12 Oct 2006 19:43:47 +0200 Subject: thr_alarm.c, thr_lock.c, my_global.h: Avoid multiple define of DBUG_OFF (bug#21749) --- include/my_global.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/my_global.h b/include/my_global.h index 39947735f3c..a7ec41068b3 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -614,12 +614,17 @@ C_MODE_END #define _STATIC_VARARGS(X) X #define _PC(X) X +/* The DBUG_ON flag always takes precedence over default DBUG_OFF */ #if defined(DBUG_ON) && defined(DBUG_OFF) #undef DBUG_OFF #endif -#if defined(_lint) && !defined(DBUG_OFF) -#define DBUG_OFF +/* We might be forced to turn debug off, if not turned off already */ +#if (defined(FORCE_DBUG_OFF) || defined(_lint)) && !defined(DBUG_OFF) +# define DBUG_OFF +# ifdef DBUG_ON +# undef DBUG_ON +# endif #endif #include -- cgit v1.2.1 From a1310d84beaf367f6e085e7a1d9ad3aee4046836 Mon Sep 17 00:00:00 2001 From: "gkodinov/kgeorge@macbook.gmz" <> Date: Mon, 16 Oct 2006 18:09:58 +0300 Subject: Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on strings MySQL is setting the flag HA_END_SPACE_KEYS for all the keys that reference text or varchar columns with collation different than binary. This was done to handle correctly the situation where a lookup on such a key may return more than 1 row because of the presence of many rows that differ only by the amount of trailing space in the table's string column. Inserting such values however appears to violate the unique checks on INSERT/UPDATE. Thus that flag must not be set as it will prevent the optimizer from choosing a faster access method. This fix removes the setting of the HA_END_SPACE_KEYS flag. --- include/my_base.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/my_base.h b/include/my_base.h index d8a0e15ccbe..985a27a0c54 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -224,12 +224,17 @@ enum ha_base_keytype { /* poor old NISAM has 8-bit flags :-( */ #define HA_SORT_ALLOWS_SAME 128 /* Intern bit when sorting records */ #endif +#if MYSQL_VERSION_ID < 0x50200 /* Key has a part that can have end space. If this is an unique key we have to handle it differently from other unique keys as we can find many matching rows for one key (because end space are not compared) */ -#define HA_END_SPACE_KEY 4096 +#define HA_END_SPACE_KEY 0 /* was: 4096 */ +#else +#error HA_END_SPACE_KEY is obsolete, please remove it +#endif + /* These flags can be added to key-seg-flag */ -- cgit v1.2.1 From da721fe7aa87df01283b3550704f9b854aac9e7f Mon Sep 17 00:00:00 2001 From: "mmj@tiger.local[mmj]" <> Date: Tue, 24 Oct 2006 19:05:11 +0200 Subject: Bug #23427: incompatible ABI change in 5.0.26? Revert 1 June change enough to restore ABI compatibility with previous versions. --- include/mysql.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include') diff --git a/include/mysql.h b/include/mysql.h index ae4a8222c5b..8ef3f1273ec 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -293,12 +293,6 @@ typedef struct st_mysql /* needed for embedded server - no net buffer to store the 'info' */ char *info_buffer; #endif - /* - 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