Below is the list of changes that have just been committed into a local
5.0 repository of kostja. When kostja 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.2028 06/02/02 18:17:18 konstantin@stripped +32 -0
Merge mysql.com:/opt/local/work/mysql-4.1-root
into mysql.com:/opt/local/work/mysql-5.0-root
tests/mysql_client_test.c
1.171 06/02/02 18:17:13 konstantin@stripped +51 -33
Manual merge.
sql/sql_update.cc
1.184 06/02/02 18:17:13 konstantin@stripped +5 -5
Manual merge.
sql/sql_parse.cc
1.524 06/02/02 18:17:13 konstantin@stripped +0 -10
Manual merge.
sql/sql_class.cc
1.226 06/02/02 18:17:12 konstantin@stripped +1 -1
Manual merge.
sql/item_timefunc.cc
1.101 06/02/02 18:17:12 konstantin@stripped +2 -4
Manual merge.
sql/ha_heap.h
1.39 06/02/02 18:17:12 konstantin@stripped +0 -1
Manual merge.
sql/ha_heap.cc
1.75 06/02/02 18:17:12 konstantin@stripped +7 -12
Manual merge.
mysql-test/r/kill.result
1.10 06/02/02 18:17:12 konstantin@stripped +12 -12
Manual merge.
mysql-test/r/heap_hash.result
1.18 06/02/02 18:17:12 konstantin@stripped +6 -10
Manual merge.
mysql-test/r/heap.result
1.43 06/02/02 18:17:12 konstantin@stripped +1 -11
Manual merge.
libmysql/libmysql.c
1.233 06/02/02 18:17:12 konstantin@stripped +1 -1
Manual merge.
configure.in
1.374 06/02/02 18:17:12 konstantin@stripped +1 -4
Manual merge.
sql/sql_select.h
1.105 06/02/02 17:25:23 konstantin@stripped +0 -0
Auto merged
sql/sql_select.cc
1.390 06/02/02 17:25:23 konstantin@stripped +0 -0
Auto merged
sql/sql_base.cc
1.325 06/02/02 17:25:22 konstantin@stripped +0 -0
Auto merged
ndb/test/ndbapi/testBlobs.cpp
1.26 06/02/02 17:25:22 konstantin@stripped +0 -0
Auto merged
ndb/include/mgmapi/mgmapi_config_parameters.h
1.20 06/02/02 17:25:22 konstantin@stripped +0 -0
Auto merged
mysql-test/t/update.test
1.28 06/02/02 17:25:22 konstantin@stripped +0 -0
Auto merged
mysql-test/t/kill.test
1.19 06/02/02 17:25:22 konstantin@stripped +0 -0
Auto merged
mysql-test/t/heap.test
1.31 06/02/02 17:25:22 konstantin@stripped +0 -0
Auto merged
mysql-test/t/date_formats.test
1.15 06/02/02 17:25:22 konstantin@stripped +0 -0
Auto merged
mysql-test/r/update.result
1.30 06/02/02 17:25:22 konstantin@stripped +0 -0
Auto merged
mysql-test/r/myisam.result
1.72 06/02/02 17:25:22 konstantin@stripped +0 -0
Auto merged
mysql-test/r/date_formats.result
1.19 06/02/02 17:25:22 konstantin@stripped +0 -0
Auto merged
heap/hp_create.c
1.22 06/02/02 17:25:21 konstantin@stripped +0 -0
Auto merged
BitKeeper/deleted/.del-rpl_multi_update4.test
1.2 06/02/02 17:25:21 konstantin@stripped +0 -0
Delete: mysql-test/t/rpl_multi_update4.test
BitKeeper/deleted/.del-disabled.def
1.3 06/02/02 17:25:21 konstantin@stripped +0 -0
Auto merged
BitKeeper/deleted/.del-rpl_multi_update4-slave.opt
1.2 06/02/02 17:25:05 konstantin@stripped +0 -0
Delete: mysql-test/t/rpl_multi_update4-slave.opt
BitKeeper/deleted/.del-rpl_ignore_table.test
1.2 06/02/02 17:24:57 konstantin@stripped +0 -0
Delete: mysql-test/t/rpl_ignore_table.test
BitKeeper/deleted/.del-rpl_ignore_table-slave.opt
1.2 06/02/02 17:24:47 konstantin@stripped +0 -0
Delete: mysql-test/t/rpl_ignore_table-slave.opt
BitKeeper/deleted/.del-rpl_multi_update4.result
1.2 06/02/02 17:24:37 konstantin@stripped +0 -0
Delete: mysql-test/r/rpl_multi_update4.result
BitKeeper/deleted/.del-rpl_ignore_table.result
1.2 06/02/02 17:24:06 konstantin@stripped +0 -0
Delete: mysql-test/r/rpl_ignore_table.result
BitKeeper/deleted/.del-disabled.def
1.1.1.2 06/02/02 17:10:58 konstantin@stripped +0 -0
Merge rename: mysql-test/t/disabled.def -> BitKeeper/deleted/.del-disabled.def
# 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: konstantin
# Host: dragonfly.local
# Root: /opt/local/work/mysql-5.0-root/RESYNC
--- 1.373/configure.in 2006-01-18 15:14:58 +03:00
+++ 1.374/configure.in 2006-02-02 18:17:12 +03:00
@@ -365,7 +365,7 @@
# libmysqlclient versioning when linked with GNU ld.
if $LD --version 2>/dev/null|grep -q GNU; then
- LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libmysql/libmysql.ver"
+ LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libmysql/libmysql.ver"
AC_CONFIG_FILES(libmysql/libmysql.ver)
fi
AC_SUBST(LD_VERSION_SCRIPT)
--- 1.21/heap/hp_create.c 2005-10-27 21:04:31 +04:00
+++ 1.22/heap/hp_create.c 2006-02-02 17:25:21 +03:00
@@ -135,6 +135,7 @@
DBUG_RETURN(1);
}
share->keydef= (HP_KEYDEF*) (share + 1);
+ share->key_stat_version= 1;
keyseg= (HA_KEYSEG*) (share->keydef + keys);
init_block(&share->block, reclength + 1, min_records, max_records);
/* Fix keys */
--- 1.232/libmysql/libmysql.c 2006-01-18 15:14:58 +03:00
+++ 1.233/libmysql/libmysql.c 2006-02-02 18:17:12 +03:00
@@ -5036,6 +5036,12 @@
{
DBUG_ENTER("mysql_stmt_reset");
DBUG_ASSERT(stmt != 0);
+ if (!stmt->mysql)
+ {
+ /* mysql can be reset in mysql_close called from mysql_reconnect */
+ set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate);
+ DBUG_RETURN(1);
+ }
/* Reset the client and server sides of the prepared statement */
DBUG_RETURN(reset_stmt_handle(stmt, RESET_SERVER_SIDE | RESET_LONG_DATA));
}
--- 1.74/sql/ha_heap.cc 2005-10-03 07:03:41 +04:00
+++ 1.75/sql/ha_heap.cc 2006-02-02 18:17:12 +03:00
@@ -53,7 +53,7 @@
ha_heap::ha_heap(TABLE *table_arg)
:handler(&heap_hton, table_arg), file(0), records_changed(0),
- key_stats_ok(0)
+ key_stats_version(0)
{}
@@ -104,7 +104,7 @@
ha_heap::info(), which is always called before key statistics are
used.
*/
- key_stats_ok= FALSE;
+ key_stat_version= file->s->key_stat_version-1;
}
return (file ? 0 : 1);
}
@@ -151,14 +151,21 @@
continue;
if (key->algorithm != HA_KEY_ALG_BTREE)
{
- ha_rows hash_buckets= file->s->keydef[i].hash_buckets;
- key->rec_per_key[key->key_parts-1]=
- hash_buckets ? file->s->records/hash_buckets : 0;
+ if (key->flags & HA_NOSAME)
+ key->rec_per_key[key->key_parts-1]= 1;
+ else
+ {
+ ha_rows hash_buckets= file->s->keydef[i].hash_buckets;
+ uint no_records= hash_buckets ? file->s->records/hash_buckets : 2;
+ if (no_records < 2)
+ no_records= 2;
+ key->rec_per_key[key->key_parts-1]= no_records;
+ }
}
}
records_changed= 0;
/* At the end of update_key_stats() we can proudly claim they are OK. */
- key_stats_ok= TRUE;
+ key_stat_version= file->s->key_stat_version;
}
@@ -173,7 +180,13 @@
res= heap_write(file,buf);
if (!res && (++records_changed*HEAP_STATS_UPDATE_THRESHOLD >
file->s->records))
- key_stats_ok= FALSE;
+ {
+ /*
+ We can perform this safely since only one writer at the time is
+ allowed on the table.
+ */
+ file->s->key_stat_version++;
+ }
return res;
}
@@ -186,7 +199,13 @@
res= heap_update(file,old_data,new_data);
if (!res && ++records_changed*HEAP_STATS_UPDATE_THRESHOLD >
file->s->records)
- key_stats_ok= FALSE;
+ {
+ /*
+ We can perform this safely since only one writer at the time is
+ allowed on the table.
+ */
+ file->s->key_stat_version++;
+ }
return res;
}
@@ -197,7 +216,13 @@
res= heap_delete(file,buf);
if (!res && table->s->tmp_table == NO_TMP_TABLE &&
++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records)
- key_stats_ok= FALSE;
+ {
+ /*
+ We can perform this safely since only one writer at the time is
+ allowed on the table.
+ */
+ file->s->key_stat_version++;
+ }
return res;
}
@@ -324,7 +349,7 @@
have to update the key statistics. Hoping that a table lock is now
in place.
*/
- if (! key_stats_ok)
+ if (key_stat_version != file->s->key_stat_version)
update_key_stats();
}
@@ -337,7 +362,13 @@
{
heap_clear(file);
if (table->s->tmp_table == NO_TMP_TABLE)
- key_stats_ok= FALSE;
+ {
+ /*
+ We can perform this safely since only one writer at the time is
+ allowed on the table.
+ */
+ file->s->key_stat_version++;
+ }
return 0;
}
@@ -496,6 +527,9 @@
min_key->flag != HA_READ_KEY_EXACT ||
max_key->flag != HA_READ_AFTER_KEY)
return HA_POS_ERROR; // Can only use exact keys
+
+ if (records <= 1)
+ return records;
/* Assert that info() did run. We need current statistics here. */
DBUG_ASSERT(key_stats_ok);
--- 1.38/sql/ha_heap.h 2005-08-06 00:19:44 +04:00
+++ 1.39/sql/ha_heap.h 2006-02-02 18:17:12 +03:00
@@ -29,7 +29,7 @@
key_map btree_keys;
/* number of records changed since last statistics update */
uint records_changed;
- bool key_stats_ok;
+ uint key_stat_version;
public:
ha_heap(TABLE *table);
~ha_heap() {}
--- 1.100/sql/item_timefunc.cc 2005-11-21 22:15:41 +03:00
+++ 1.101/sql/item_timefunc.cc 2006-02-02 18:17:12 +03:00
@@ -3023,9 +3023,9 @@
cached_field_type= MYSQL_TYPE_STRING;
max_length= MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
cached_timestamp_type= MYSQL_TIMESTAMP_NONE;
- if ((const_item= args[1]->const_item()))
+ format= args[1]->val_str(&format_str);
+ if (!args[1]->null_value && (const_item= args[1]->const_item()))
{
- format= args[1]->val_str(&format_str);
cached_format_type= get_date_time_result_type(format->ptr(),
format->length());
switch (cached_format_type) {
--- 1.225/sql/sql_class.cc 2006-01-10 19:56:16 +03:00
+++ 1.226/sql/sql_class.cc 2006-02-02 18:17:12 +03:00
@@ -1816,11 +1816,14 @@
void TMP_TABLE_PARAM::init()
{
+ DBUG_ENTER("TMP_TABLE_PARAM::init");
+ DBUG_PRINT("enter", ("this: 0x%lx", (ulong)this));
field_count= sum_func_count= func_count= hidden_field_count= 0;
group_parts= group_length= group_null_parts= 0;
quick_group= 1;
table_charset= 0;
precomputed_group_by= 0;
+ DBUG_VOID_RETURN;
}
--- 1.389/sql/sql_select.cc 2006-01-28 08:20:09 +03:00
+++ 1.390/sql/sql_select.cc 2006-02-02 17:25:23 +03:00
@@ -6016,6 +6016,20 @@
problems in free_elements() as some of the elements are then deleted.
*/
tmp_table_param.copy_funcs.empty();
+ /*
+ If we have tmp_join and 'this' JOIN is not tmp_join and
+ tmp_table_param.copy_field's of them are equal then we have to remove
+ pointer to tmp_table_param.copy_field from tmp_join, because it qill
+ be removed in tmp_table_param.cleanup().
+ */
+ if (tmp_join &&
+ tmp_join != this &&
+ tmp_join->tmp_table_param.copy_field ==
+ tmp_table_param.copy_field)
+ {
+ tmp_join->tmp_table_param.copy_field=
+ tmp_join->tmp_table_param.save_copy_field= 0;
+ }
tmp_table_param.cleanup();
}
DBUG_VOID_RETURN;
--- 1.104/sql/sql_select.h 2005-12-07 17:01:08 +03:00
+++ 1.105/sql/sql_select.h 2006-02-02 17:25:23 +03:00
@@ -285,7 +285,14 @@
{
init(thd_arg, fields_arg, select_options_arg, result_arg);
}
-
+
+ JOIN(JOIN &join)
+ :fields_list(join.fields_list)
+ {
+ init(join.thd, join.fields_list, join.select_options,
+ join.result);
+ }
+
void init(THD *thd_arg, List<Item> &fields_arg, ulonglong select_options_arg,
select_result *result_arg)
{
@@ -332,7 +339,7 @@
all_fields= fields_arg;
fields_list= fields_arg;
bzero((char*) &keyuse,sizeof(keyuse));
- tmp_table_param.copy_field=0;
+ tmp_table_param.init();
tmp_table_param.end_write_records= HA_POS_ERROR;
rollup.state= ROLLUP::STATE_NONE;
}
--- 1.183/sql/sql_update.cc 2005-12-28 17:20:17 +03:00
+++ 1.184/sql/sql_update.cc 2006-02-02 18:17:13 +03:00
@@ -308,7 +308,6 @@
SORT_FIELD *sortorder;
ha_rows examined_rows;
- used_index= MAX_KEY; // For call to init_read_record()
table->sort.io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE),
MYF(MY_FAE | MY_ZEROFILL));
if (!(sortorder=make_unireg_sortorder(order, &length)) ||
@@ -339,10 +338,21 @@
if (open_cached_file(&tempfile, mysql_tmpdir,TEMP_PREFIX,
DISK_BUFFER_SIZE, MYF(MY_WME)))
goto err;
-
+
/* If quick select is used, initialize it before retrieving rows. */
if (select && select->quick && select->quick->reset())
goto err;
+
+ /*
+ When we get here, we have one of the following options:
+ A. used_index == MAX_KEY
+ This means we should use full table scan, and start it with
+ init_read_record call
+ B. used_index != MAX_KEY
+ B.1 quick select is used, start the scan with init_read_record
+ B.2 quick select is not used, this is full index scan (with LIMIT)
+ Full index scan must be started with init_read_record_idx
+ */
if (used_index == MAX_KEY || (select && select->quick))
init_read_record(&info,thd,table,select,0,1);
else
--- 1.18/mysql-test/r/date_formats.result 2005-10-27 21:04:31 +04:00
+++ 1.19/mysql-test/r/date_formats.result 2006-02-02 17:25:22 +03:00
@@ -503,3 +503,12 @@
02 February
01 January
drop table t1;
+select str_to_date( 1, NULL );
+str_to_date( 1, NULL )
+NULL
+select str_to_date( NULL, 1 );
+str_to_date( NULL, 1 )
+NULL
+select str_to_date( 1, IF(1=1,NULL,NULL) );
+str_to_date( 1, IF(1=1,NULL,NULL) )
+NULL
--- 1.14/mysql-test/t/date_formats.test 2005-10-27 21:04:32 +04:00
+++ 1.15/mysql-test/t/date_formats.test 2006-02-02 17:25:22 +03:00
@@ -269,4 +269,11 @@
insert into t1 (f1) values ("2005-02-01");
select date_format(f1, "%m") as d1, date_format(f1, "%M") as d2 from t1 order by date_format(f1, "%M");
drop table t1;
+
+#
+# Bug #15828
+#
+select str_to_date( 1, NULL );
+select str_to_date( NULL, 1 );
+select str_to_date( 1, IF(1=1,NULL,NULL) );
# End of 4.1 tests
--- 1.19/ndb/include/mgmapi/mgmapi_config_parameters.h 2005-10-12 16:17:28 +04:00
+++ 1.20/ndb/include/mgmapi/mgmapi_config_parameters.h 2006-02-02 17:25:22 +03:00
@@ -85,6 +85,11 @@
#define CFG_DB_BACKUP_DATADIR 158
#define CFG_DB_MAX_OPEN_FILES 159
+#define CFG_DB_DISK_PAGE_BUFFER_MEMORY 160 /* used from 5.1 */
+#define CFG_DB_STRING_MEMORY 161 /* used from 5.1 */
+#define CFG_DB_INITIAL_OPEN_FILES 162 /* used from 5.1 */
+
+#define CFG_DB_DATA_MEM_2 199 /* used in special build in 5.1 */
#define CFG_NODE_ARBIT_RANK 200
#define CFG_NODE_ARBIT_DELAY 201
--- 1.25/ndb/test/ndbapi/testBlobs.cpp 2005-07-01 11:53:38 +04:00
+++ 1.26/ndb/test/ndbapi/testBlobs.cpp 2006-02-02 17:25:22 +03:00
@@ -1483,13 +1483,16 @@
// insert char (one trans)
{
DBG("--- insert char ---");
+ char b[20];
t1.on();
CHK((g_con = g_ndb->startTransaction()) != 0);
for (Uint32 k = 0; k < g_opt.m_rowsperf; k++) {
CHK((g_opr = g_con->getNdbOperation(tab.getName())) != 0);
CHK(g_opr->insertTuple() == 0);
CHK(g_opr->equal(cA, (char*)&k) == 0);
- CHK(g_opr->setValue(cB, "b") == 0);
+ memset(b, 0x20, sizeof(b));
+ b[0] = 'b';
+ CHK(g_opr->setValue(cB, b) == 0);
CHK(g_con->execute(NoCommit) == 0);
}
t1.off(g_opt.m_rowsperf);
@@ -1526,12 +1529,15 @@
{
DBG("--- insert for read test ---");
unsigned n = 0;
+ char b[20];
CHK((g_con = g_ndb->startTransaction()) != 0);
for (Uint32 k = 0; k < g_opt.m_rowsperf; k++) {
CHK((g_opr = g_con->getNdbOperation(tab.getName())) != 0);
CHK(g_opr->insertTuple() == 0);
CHK(g_opr->equal(cA, (char*)&k) == 0);
- CHK(g_opr->setValue(cB, "b") == 0);
+ memset(b, 0x20, sizeof(b));
+ b[0] = 'b';
+ CHK(g_opr->setValue(cB, b) == 0);
CHK((g_bh1 = g_opr->getBlobHandle(cC)) != 0);
CHK((g_bh1->setValue("c", 1) == 0));
if (++n == g_opt.m_batch) {
@@ -1565,7 +1571,7 @@
a = (Uint32)-1;
b[0] = 0;
CHK(g_con->execute(NoCommit) == 0);
- CHK(a == k && strcmp(b, "b") == 0);
+ CHK(a == k && b[0] == 'b');
}
CHK(g_con->execute(Commit) == 0);
t1.off(g_opt.m_rowsperf);
@@ -1591,7 +1597,7 @@
CHK(g_con->execute(NoCommit) == 0);
Uint32 m = 20;
CHK(g_bh1->readData(c, m) == 0);
- CHK(a == k && m == 1 && strcmp(c, "c") == 0);
+ CHK(a == k && m == 1 && c[0] == 'c');
}
CHK(g_con->execute(Commit) == 0);
t2.off(g_opt.m_rowsperf);
@@ -1623,7 +1629,7 @@
CHK((ret = g_ops->nextResult(true)) == 0 || ret == 1);
if (ret == 1)
break;
- CHK(a < g_opt.m_rowsperf && strcmp(b, "b") == 0);
+ CHK(a < g_opt.m_rowsperf && b[0] == 'b');
n++;
}
CHK(n == g_opt.m_rowsperf);
@@ -1654,7 +1660,7 @@
break;
Uint32 m = 20;
CHK(g_bh1->readData(c, m) == 0);
- CHK(a < g_opt.m_rowsperf && m == 1 && strcmp(c, "c") == 0);
+ CHK(a < g_opt.m_rowsperf && m == 1 && c[0] == 'c');
n++;
}
CHK(n == g_opt.m_rowsperf);
--- 1.29/mysql-test/r/update.result 2005-12-02 19:32:56 +03:00
+++ 1.30/mysql-test/r/update.result 2006-02-02 17:25:22 +03:00
@@ -358,3 +358,22 @@
affected rows: 3
info: Rows matched: 3 Changed: 3 Warnings: 0
drop table t1,t2;
+create table t1 (a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int, filler1 char(200), filler2 char(200), key(a));
+insert into t2 select A.a + 10*B.a, 'filler','filler' from t1 A, t1 B;
+flush status;
+update t2 set a=3 where a=2;
+show status like 'handler_read%';
+Variable_name Value
+Handler_read_first 0
+Handler_read_key 1
+Handler_read_next 1
+Handler_read_prev 0
+Handler_read_rnd 1
+Handler_read_rnd_next 0
+drop table t1, t2;
+create table t1(f1 int, `*f2` int);
+insert into t1 values (1,1);
+update t1 set `*f2`=1;
+drop table t1;
--- 1.30/mysql-test/t/heap.test 2005-08-09 12:21:41 +04:00
+++ 1.31/mysql-test/t/heap.test 2006-02-02 17:25:22 +03:00
@@ -436,6 +436,17 @@
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
drop table t1;
+#
+# Bug 12796: Record doesn't show when selecting through index
+#
+CREATE TABLE t1 (a int, key(a)) engine=heap;
+insert delayed into t1 values (0);
+delete from t1;
+select * from t1;
+insert delayed into t1 values (0), (1);
+select * from t1 where a = 0;
+drop table t1;
+
# End of 4.1 tests
#
--- 1.27/mysql-test/t/update.test 2005-12-02 19:32:56 +03:00
+++ 1.28/mysql-test/t/update.test 2006-02-02 17:25:22 +03:00
@@ -287,4 +287,23 @@
update t2,t1 set f1=3,f2=3 where f1=f2 and f1=1;
--disable_info
drop table t1,t2;
+
+
+# BUG#15935
+create table t1 (a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int, filler1 char(200), filler2 char(200), key(a));
+insert into t2 select A.a + 10*B.a, 'filler','filler' from t1 A, t1 B;
+flush status;
+update t2 set a=3 where a=2;
+show status like 'handler_read%';
+drop table t1, t2;
+
+#
+# Bug #16510 Updating field named like '*name' caused server crash
+#
+create table t1(f1 int, `*f2` int);
+insert into t1 values (1,1);
+update t1 set `*f2`=1;
+drop table t1;
# End of 4.1 tests
--- 1.71/mysql-test/r/myisam.result 2005-11-16 12:13:05 +03:00
+++ 1.72/mysql-test/r/myisam.result 2006-02-02 17:25:22 +03:00
@@ -567,7 +567,7 @@
Note 1031 Table storage engine for 't1' doesn't have this option
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a NULL 1000 NULL NULL YES HASH
+t1 1 a 1 a NULL 500 NULL NULL YES HASH
drop table t1,t2;
create table t1 ( a tinytext, b char(1), index idx (a(1),b) );
insert into t1 values (null,''), (null,'');
--- 1.9/mysql-test/r/kill.result 2006-01-06 01:47:39 +03:00
+++ 1.10/mysql-test/r/kill.result 2006-02-02 18:17:12 +03:00
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1, t2, t3;
create table t1 (kill_id int);
insert into t1 values(connection_id());
select ((@id := kill_id) - kill_id) from t1;
@@ -27,3 +27,15 @@
select RELEASE_LOCK("a");
RELEASE_LOCK("a")
1
+create table t1 (id int primary key);
+create table t2 (id int unsigned not null);
+insert into t2 select id from t1;
+create table t3 (kill_id int);
+insert into t3 values(connection_id());
+ select id from t1 where id in (select distinct id from t2);
+select ((@id := kill_id) - kill_id) from t3;
+((@id := kill_id) - kill_id)
+0
+kill @id;
+ERROR 08S01: Server shutdown in progress
+drop table t1, t2, t3;
--- 1.18/mysql-test/t/kill.test 2006-01-06 01:47:40 +03:00
+++ 1.19/mysql-test/t/kill.test 2006-02-02 17:25:22 +03:00
@@ -12,7 +12,7 @@
#remember id of con1
connection con1;
--disable_warnings
-drop table if exists t1;
+drop table if exists t1, t2, t3;
--enable_warnings
--disable_reconnect
@@ -46,6 +46,53 @@
connection con2;
select 4;
drop table t1;
+
+disconnect con2;
+connection default;
+#
+# BUG#14851: killing long running subquery processed via a temporary table.
+#
+create table t1 (id int primary key);
+create table t2 (id int unsigned not null);
+
+connect (conn1, localhost, root,,);
+connection conn1;
+
+-- disable_result_log
+-- disable_query_log
+let $1 = 4096;
+while ($1)
+{
+ eval insert into t1 values ($1);
+ dec $1;
+}
+-- enable_query_log
+-- enable_result_log
+
+insert into t2 select id from t1;
+
+create table t3 (kill_id int);
+insert into t3 values(connection_id());
+
+-- disable_result_log
+send select id from t1 where id in (select distinct id from t2);
+-- enable_result_log
+
+connect (conn2, localhost, root,,);
+connection conn2;
+select ((@id := kill_id) - kill_id) from t3;
+-- sleep 1
+kill @id;
+
+connection conn1;
+-- error 1053
+reap;
+
+disconnect conn1;
+disconnect conn2;
+connection default;
+
+drop table t1, t2, t3;
# End of 4.1 tests
--- 1.170/tests/mysql_client_test.c 2006-01-30 13:02:05 +03:00
+++ 1.171/tests/mysql_client_test.c 2006-02-02 18:17:13 +03:00
@@ -14714,6 +14714,56 @@
mysql_stmt_close(stmt);
}
+
+static void test_bug12744()
+{
+ MYSQL_STMT *prep_stmt = NULL;
+ int rc;
+ myheader("test_bug12744");
+
+ prep_stmt= mysql_stmt_init(mysql);
+ rc= mysql_stmt_prepare(prep_stmt, "SELECT 1", 8);
+ DIE_UNLESS(rc==0);
+
+ rc= mysql_kill(mysql, mysql_thread_id(mysql));
+ DIE_UNLESS(rc==0);
+
+ if (rc= mysql_stmt_execute(prep_stmt))
+ {
+ if (rc= mysql_stmt_reset(prep_stmt))
+ printf("OK!\n");
+ else
+ {
+ printf("Error!");
+ DIE_UNLESS(1==0);
+ }
+ }
+ else
+ {
+ fprintf(stderr, "expected error but no error occured\n");
+ DIE_UNLESS(1==0);
+ }
+ rc= mysql_stmt_close(prep_stmt);
+}
+
+/* Bug #16144: mysql_stmt_attr_get type error */
+
+static void test_bug16144()
+{
+ const my_bool flag_orig= (my_bool) 0xde;
+ my_bool flag= flag_orig;
+ MYSQL_STMT *stmt;
+ myheader("test_bug16144");
+
+ /* Check that attr_get returns correct data on little and big endian CPUs */
+ stmt= mysql_stmt_init(mysql);
+ mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (const void*) &flag);
+ mysql_stmt_attr_get(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void*) &flag);
+ DIE_UNLESS(flag == flag_orig);
+
+ mysql_stmt_close(stmt);
+}
+
/*
Bug #15613: "libmysqlclient API function mysql_stmt_prepare returns wrong
field length"
@@ -15039,7 +15089,7 @@
{ "test_bug14845", test_bug14845 },
{ "test_bug15510", test_bug15510 },
{ "test_opt_reconnect", test_opt_reconnect },
-
+ { "test_bug12744", test_bug12744 },
{ "test_bug16144", test_bug16144 },
{ "test_bug15613", test_bug15613 },
{ 0, 0 }
| Thread |
|---|
| • bk commit into 5.0 tree (konstantin:1.2028) | konstantin | 2 Feb |