Below is the list of changes that have just been committed into a local
5.0 repository of igor. When igor does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2164 06/04/19 18:08:15 igor@stripped +12 -0
Merge rurik.mysql.com:/home/igor/dev/mysql-4.1-2
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
sql/unireg.h
1.44 06/04/19 18:08:10 igor@stripped +0 -1
Manual merge
sql/sql_select.cc
1.405 06/04/19 18:08:10 igor@stripped +11 -8
Manual merge
sql/lock.cc
1.87 06/04/19 18:08:10 igor@stripped +1 -1
Manual merge
sql/item_sum.h
1.101 06/04/19 18:08:10 igor@stripped +0 -7
Manual merge
sql/item_func.cc
1.279 06/04/19 18:08:10 igor@stripped +3 -1
Manual merge
mysql-test/t/key_cache.test
1.18 06/04/19 18:08:10 igor@stripped +0 -0
Manual merge
mysql-test/t/func_gconcat.test
1.42 06/04/19 18:08:10 igor@stripped +0 -0
Manual merge
mysql-test/r/key_cache.result
1.17 06/04/19 18:08:10 igor@stripped +0 -0
Manual merge
mysql-test/r/func_gconcat.result
1.55 06/04/19 18:08:10 igor@stripped +0 -0
Manual merge
ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp
1.9 06/04/19 16:22:53 igor@stripped +0 -0
Auto merged
ndb/src/kernel/SimBlockList.cpp
1.9 06/04/19 16:22:53 igor@stripped +0 -0
Auto merged
mysys/mf_keycache.c
1.56 06/04/19 16:22:53 igor@stripped +0 -0
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: igor
# Host: rurik.mysql.com
# Root: /home/igor/dev/mysql-5.0-0/RESYNC
--- 1.55/mysys/mf_keycache.c 2005-10-11 14:58:17 -07:00
+++ 1.56/mysys/mf_keycache.c 2006-04-19 16:22:53 -07:00
@@ -1805,6 +1805,7 @@
uint status;
int page_st;
+ offset= (uint) (filepos & (keycache->key_cache_block_size-1));
/* Read data in key_cache_block_size increments */
do
{
@@ -1814,7 +1815,6 @@
keycache_pthread_mutex_unlock(&keycache->cache_lock);
goto no_key_cache;
}
- offset= (uint) (filepos & (keycache->key_cache_block_size-1));
filepos-= offset;
read_length= length;
set_if_smaller(read_length, keycache->key_cache_block_size-offset);
@@ -1890,6 +1890,7 @@
#endif
buff+= read_length;
filepos+= read_length+offset;
+ offset= 0;
} while ((length-= read_length));
DBUG_RETURN(start);
@@ -1941,17 +1942,17 @@
uint read_length;
int page_st;
int error;
+ uint offset;
+ offset= (uint) (filepos & (keycache->key_cache_block_size-1));
do
{
- uint offset;
keycache_pthread_mutex_lock(&keycache->cache_lock);
if (!keycache->can_be_used)
{
keycache_pthread_mutex_unlock(&keycache->cache_lock);
DBUG_RETURN(0);
}
- offset= (uint) (filepos & (keycache->key_cache_block_size-1));
/* Read data into key cache from buff in key_cache_block_size incr. */
filepos-= offset;
read_length= length;
@@ -2009,6 +2010,7 @@
buff+= read_length;
filepos+= read_length+offset;
+ offset= 0;
} while ((length-= read_length));
}
@@ -2075,17 +2077,17 @@
/* Key cache is used */
uint read_length;
int page_st;
+ uint offset;
+ offset= (uint) (filepos & (keycache->key_cache_block_size-1));
do
{
- uint offset;
keycache_pthread_mutex_lock(&keycache->cache_lock);
if (!keycache->can_be_used)
{
keycache_pthread_mutex_unlock(&keycache->cache_lock);
goto no_key_cache;
}
- offset= (uint) (filepos & (keycache->key_cache_block_size-1));
/* Write data in key_cache_block_size increments */
filepos-= offset;
read_length= length;
--- 1.278/sql/item_func.cc 2006-04-13 16:02:23 -07:00
+++ 1.279/sql/item_func.cc 2006-04-19 18:08:10 -07:00
@@ -380,7 +380,10 @@
res= new Field_double(max_length, maybe_null, name, t_arg, decimals);
break;
case STRING_RESULT:
- res= make_string_field(t_arg);
+ if (max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB)
+ res= new Field_blob(max_length, maybe_null, name, t_arg, collation.collation);
+ else
+ res= new Field_string(max_length, maybe_null, name, t_arg, collation.collation);
break;
case DECIMAL_RESULT:
res= new Field_new_decimal(my_decimal_precision_to_length(decimal_precision(),
--- 1.100/sql/item_sum.h 2006-03-30 07:03:25 -08:00
+++ 1.101/sql/item_sum.h 2006-04-19 18:08:10 -07:00
@@ -1124,7 +1124,7 @@
if (max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB)
return FIELD_TYPE_BLOB;
else
- return MYSQL_TYPE_VARCHAR;
+ return MYSQL_TYPE_VAR_STRING;
}
void clear();
bool add();
--- 1.86/sql/lock.cc 2006-04-05 05:39:15 -07:00
+++ 1.87/sql/lock.cc 2006-04-19 18:08:10 -07:00
@@ -78,6 +78,7 @@
static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table,uint count,
uint flags, TABLE **write_locked);
+static void reset_lock_data(MYSQL_LOCK *sql_lock);
static int lock_external(THD *thd, TABLE **table,uint count);
static int unlock_external(THD *thd, TABLE **table,uint count);
static void print_lock_error(int error, const char *);
@@ -135,12 +136,16 @@
*/
if (wait_if_global_read_lock(thd, 1, 1))
{
+ /* Clear the lock type of all lock data to avoid reusage. */
+ reset_lock_data(sql_lock);
my_free((gptr) sql_lock,MYF(0));
sql_lock=0;
break;
- }
+ }
if (thd->version != refresh_version)
{
+ /* Clear the lock type of all lock data to avoid reusage. */
+ reset_lock_data(sql_lock);
my_free((gptr) sql_lock,MYF(0));
goto retry;
}
@@ -149,6 +154,8 @@
thd->proc_info="System lock";
if (lock_external(thd, tables, count))
{
+ /* Clear the lock type of all lock data to avoid reusage. */
+ reset_lock_data(sql_lock);
my_free((gptr) sql_lock,MYF(0));
sql_lock=0;
break;
@@ -699,7 +706,10 @@
*write_lock_used=table;
if (table->db_stat & HA_READ_ONLY)
{
- my_error(ER_OPEN_AS_READONLY, MYF(0), table->alias);
+ my_error(ER_OPEN_AS_READONLY,MYF(0),table->alias);
+ /* Clear the lock type of the lock data that are stored already. */
+ sql_lock->lock_count= locks - sql_lock->locks;
+ reset_lock_data(sql_lock);
my_free((gptr) sql_lock,MYF(0));
DBUG_RETURN(0);
}
@@ -721,6 +731,48 @@
(*org_locks)->debug_print_param= (void *) table;
}
DBUG_RETURN(sql_lock);
+}
+
+
+/*
+ Reset lock type in lock data.
+
+ SYNOPSIS
+ reset_lock_data()
+ sql_lock The MySQL lock.
+
+ DESCRIPTION
+
+ After a locking error we want to quit the locking of the table(s).
+ The test case in the bug report for Bug #18544 has the following
+ cases: 1. Locking error in lock_external() due to InnoDB timeout.
+ 2. Locking error in get_lock_data() due to missing write permission.
+ 3. Locking error in wait_if_global_read_lock() due to lock conflict.
+
+ In all these cases we have already set the lock type into the lock
+ data of the open table(s). If the table(s) are in the open table
+ cache, they could be reused with the non-zero lock type set. This
+ could lead to ignoring a different lock type with the next lock.
+
+ Clear the lock type of all lock data. This ensures that the next
+ lock request will set its lock type properly.
+
+ RETURN
+ void
+*/
+
+static void reset_lock_data(MYSQL_LOCK *sql_lock)
+{
+ THR_LOCK_DATA **ldata;
+ THR_LOCK_DATA **ldata_end;
+
+ for (ldata= sql_lock->locks, ldata_end= ldata + sql_lock->lock_count;
+ ldata < ldata_end;
+ ldata++)
+ {
+ /* Reset lock type. */
+ (*ldata)->type= TL_UNLOCK;
+ }
}
--- 1.404/sql/sql_select.cc 2006-04-03 21:02:34 -07:00
+++ 1.405/sql/sql_select.cc 2006-04-19 18:08:10 -07:00
@@ -8245,13 +8245,20 @@
if ((type= item->field_type()) == MYSQL_TYPE_DATETIME ||
type == MYSQL_TYPE_TIME || type == MYSQL_TYPE_DATE)
new_field= item->tmp_table_field_from_field_type(table);
- else if (item->max_length/item->collation.collation->mbmaxlen > 255 &&
- convert_blob_length)
- new_field= new Field_varstring(convert_blob_length, maybe_null,
- item->name, table,
- item->collation.collation);
+ else if (item->max_length/item->collation.collation->mbmaxlen >
+ CONVERT_IF_BIGGER_TO_BLOB)
+ {
+ if (convert_blob_length)
+ new_field= new Field_varstring(convert_blob_length, maybe_null,
+ item->name, table,
+ item->collation.collation);
+ else
+ new_field= new Field_blob(item->max_length, maybe_null, item->name,
+ table, item->collation.collation);
+ }
else
- new_field= item->make_string_field(table);
+ new_field= new Field_string(item->max_length, maybe_null, item->name,
+ table, item->collation.collation);
break;
case DECIMAL_RESULT:
new_field= new Field_new_decimal(item->max_length, maybe_null, item->name,
--- 1.8/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp 2006-04-05 01:22:40 -07:00
+++ 1.9/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp 2006-04-19 16:22:53 -07:00
@@ -25,7 +25,10 @@
void Ndbcntr::initData()
{
-
+ c_start.reset();
+ cmasterNodeId = 0;
+ cnoStartNodes = 0;
+ cnoWaitrep = 0;
// Records with constant sizes
ndbBlocksRec = new NdbBlocksRec[ZSIZE_NDB_BLOCKS_REC];
}//Ndbcntr::initData()
--- 1.8/ndb/src/kernel/SimBlockList.cpp 2005-08-18 05:09:05 -07:00
+++ 1.9/ndb/src/kernel/SimBlockList.cpp 2006-04-19 16:22:53 -07:00
@@ -111,8 +111,12 @@
if(theList != 0){
for(int i = 0; i<noOfBlocks; i++){
if(theList[i] != 0){
+#ifdef VM_TRACE
theList[i]->~SimulatedBlock();
free(theList[i]);
+#else
+ delete(theList[i]);
+#endif
theList[i] = 0;
}
}
--- 1.16/mysql-test/r/key_cache.result 2005-08-07 11:39:10 -07:00
+++ 1.17/mysql-test/r/key_cache.result 2006-04-19 18:08:10 -07:00
@@ -289,6 +289,48 @@
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
+CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY);
+SET GLOBAL key_cache_block_size=1536;
+INSERT INTO t1 VALUES (1);
+SELECT @@key_cache_block_size;
+@@key_cache_block_size
+1536
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY, b int);
+CREATE TABLE t2(a int NOT NULL AUTO_INCREMENT PRIMARY KEY, b int);
+SET GLOBAL key_cache_block_size=1536;
+INSERT INTO t1 VALUES (1,0);
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4181
+SELECT @@key_cache_block_size;
+@@key_cache_block_size
+1536
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1,t2;
set @@global.key_buffer_size=0;
Warnings:
Warning 1438 Cannot drop default keycache
--- 1.17/mysql-test/t/key_cache.test 2005-08-07 11:39:11 -07:00
+++ 1.18/mysql-test/t/key_cache.test 2006-04-19 18:08:10 -07:00
@@ -149,6 +149,7 @@
--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED 1824 KEY_BLOCKS_UNUSED
show status like 'key_blocks_unused';
+
# Cleanup
# We don't reset keycache2 as we want to ensure that mysqld will reset it
set global keycache2.key_buffer_size=0;
@@ -157,7 +158,7 @@
set global keycache3.key_buffer_size=100;
set global keycache3.key_buffer_size=0;
-# Test case for buf 6447
+# Test case for bug 6447
create table t1 (mytext text, FULLTEXT (mytext));
insert t1 values ('aaabbb');
@@ -167,6 +168,44 @@
check table t1;
drop table t1;
+
+#
+# Bug #19079: corrupted index when key_cache_block_size is not multiple of
+# myisam_block_size
+
+CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY);
+SET GLOBAL key_cache_block_size=1536;
+INSERT INTO t1 VALUES (1);
+SELECT @@key_cache_block_size;
+CHECK TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY, b int);
+CREATE TABLE t2(a int NOT NULL AUTO_INCREMENT PRIMARY KEY, b int);
+SET GLOBAL key_cache_block_size=1536;
+INSERT INTO t1 VALUES (1,0);
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+INSERT INTO t2(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t2;
+SELECT COUNT(*) FROM t1;
+SELECT @@key_cache_block_size;
+CHECK TABLE t1;
+DROP TABLE t1,t2;
#
# Bug#10473 - Can't set 'key_buffer_size' system variable to ZERO
--- 1.54/mysql-test/r/func_gconcat.result 2006-04-07 01:19:26 -07:00
+++ 1.55/mysql-test/r/func_gconcat.result 2006-04-19 18:08:10 -07:00
@@ -611,6 +611,16 @@
1
3
drop table t1;
+create table t1 (f1 int unsigned, f2 varchar(255));
+insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
+select f2,group_concat(f1) from t1 group by f2;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 f2 f2 253 255 255 Y 0 0 8
+def group_concat(f1) 252 400 1 Y 128 0 63
+f2 group_concat(f1)
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2
+drop table t1;
set names latin1;
create table t1 (a char, b char);
insert into t1 values ('a', 'a'), ('a', 'b'), ('b', 'a'), ('b', 'b');
--- 1.41/mysql-test/t/func_gconcat.test 2006-04-07 01:19:26 -07:00
+++ 1.42/mysql-test/t/func_gconcat.test 2006-04-19 18:08:10 -07:00
@@ -397,6 +397,18 @@
select f1, group_concat(f1+1) from t1 group by f1 with rollup;
select count(distinct (f1+1)) from t1 group by f1 with rollup;
drop table t1;
+
+#
+# Bug#14169 type of group_concat() result changed to blob if tmp_table was used
+#
+create table t1 (f1 int unsigned, f2 varchar(255));
+insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
+--enable_metadata
+select f2,group_concat(f1) from t1 group by f2;
+# select f2,group_concat(f1) from t1 group by f2 order by 2;
+--disable_metadata
+drop table t1;
+
# End of 4.1 tests
#
| Thread |
|---|
| • bk commit into 5.0 tree (igor:1.2164) | igor | 20 Apr |