Skip to content

Commit 98091b1

Browse files
author
konstantin@mysql.com
committed
Merge mysql.com:/opt/local/work/mysql-4.1-root
into mysql.com:/opt/local/work/mysql-5.0-root
2 parents c9b7317 + 736faf4 commit 98091b1

22 files changed

+290
-29
lines changed

configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ MYSQL_PROG_AR
365365

366366
# libmysqlclient versioning when linked with GNU ld.
367367
if $LD --version 2>/dev/null|grep -q GNU; then
368-
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libmysql/libmysql.ver"
368+
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libmysql/libmysql.ver"
369369
AC_CONFIG_FILES(libmysql/libmysql.ver)
370370
fi
371371
AC_SUBST(LD_VERSION_SCRIPT)

heap/hp_create.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
135135
DBUG_RETURN(1);
136136
}
137137
share->keydef= (HP_KEYDEF*) (share + 1);
138+
share->key_stat_version= 1;
138139
keyseg= (HA_KEYSEG*) (share->keydef + keys);
139140
init_block(&share->block, reclength + 1, min_records, max_records);
140141
/* Fix keys */

include/heap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ typedef struct st_heap_share
136136
HP_KEYDEF *keydef;
137137
ulong min_records,max_records; /* Params to open */
138138
ulong data_length,index_length,max_table_size;
139+
uint key_stat_version; /* version to indicate insert/delete */
139140
uint records; /* records */
140141
uint blength; /* records rounded up to 2^n */
141142
uint deleted; /* Deleted records in database */

libmysql/libmysql.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5036,6 +5036,12 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt)
50365036
{
50375037
DBUG_ENTER("mysql_stmt_reset");
50385038
DBUG_ASSERT(stmt != 0);
5039+
if (!stmt->mysql)
5040+
{
5041+
/* mysql can be reset in mysql_close called from mysql_reconnect */
5042+
set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate);
5043+
DBUG_RETURN(1);
5044+
}
50395045
/* Reset the client and server sides of the prepared statement */
50405046
DBUG_RETURN(reset_stmt_handle(stmt, RESET_SERVER_SIDE | RESET_LONG_DATA));
50415047
}

mysql-test/r/date_formats.result

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,3 +503,12 @@ d1 d2
503503
02 February
504504
01 January
505505
drop table t1;
506+
select str_to_date( 1, NULL );
507+
str_to_date( 1, NULL )
508+
NULL
509+
select str_to_date( NULL, 1 );
510+
str_to_date( NULL, 1 )
511+
NULL
512+
select str_to_date( 1, IF(1=1,NULL,NULL) );
513+
str_to_date( 1, IF(1=1,NULL,NULL) )
514+
NULL

mysql-test/r/kill.result

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
drop table if exists t1;
1+
drop table if exists t1, t2, t3;
22
create table t1 (kill_id int);
33
insert into t1 values(connection_id());
44
select ((@id := kill_id) - kill_id) from t1;
@@ -27,3 +27,15 @@ select 1;
2727
select RELEASE_LOCK("a");
2828
RELEASE_LOCK("a")
2929
1
30+
create table t1 (id int primary key);
31+
create table t2 (id int unsigned not null);
32+
insert into t2 select id from t1;
33+
create table t3 (kill_id int);
34+
insert into t3 values(connection_id());
35+
select id from t1 where id in (select distinct id from t2);
36+
select ((@id := kill_id) - kill_id) from t3;
37+
((@id := kill_id) - kill_id)
38+
0
39+
kill @id;
40+
ERROR 08S01: Server shutdown in progress
41+
drop table t1, t2, t3;

mysql-test/r/myisam.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ Warnings:
567567
Note 1031 Table storage engine for 't1' doesn't have this option
568568
show keys from t1;
569569
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
570-
t1 1 a 1 a NULL 1000 NULL NULL YES HASH
570+
t1 1 a 1 a NULL 500 NULL NULL YES HASH
571571
drop table t1,t2;
572572
create table t1 ( a tinytext, b char(1), index idx (a(1),b) );
573573
insert into t1 values (null,''), (null,'');

mysql-test/r/update.result

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,22 @@ update t2,t1 set f1=3,f2=3 where f1=f2 and f1=1;
358358
affected rows: 3
359359
info: Rows matched: 3 Changed: 3 Warnings: 0
360360
drop table t1,t2;
361+
create table t1 (a int);
362+
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
363+
create table t2 (a int, filler1 char(200), filler2 char(200), key(a));
364+
insert into t2 select A.a + 10*B.a, 'filler','filler' from t1 A, t1 B;
365+
flush status;
366+
update t2 set a=3 where a=2;
367+
show status like 'handler_read%';
368+
Variable_name Value
369+
Handler_read_first 0
370+
Handler_read_key 1
371+
Handler_read_next 1
372+
Handler_read_prev 0
373+
Handler_read_rnd 1
374+
Handler_read_rnd_next 0
375+
drop table t1, t2;
376+
create table t1(f1 int, `*f2` int);
377+
insert into t1 values (1,1);
378+
update t1 set `*f2`=1;
379+
drop table t1;

mysql-test/t/date_formats.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,4 +269,11 @@ insert into t1 (f1) values ("2005-01-01");
269269
insert into t1 (f1) values ("2005-02-01");
270270
select date_format(f1, "%m") as d1, date_format(f1, "%M") as d2 from t1 order by date_format(f1, "%M");
271271
drop table t1;
272+
273+
#
274+
# Bug #15828
275+
#
276+
select str_to_date( 1, NULL );
277+
select str_to_date( NULL, 1 );
278+
select str_to_date( 1, IF(1=1,NULL,NULL) );
272279
# End of 4.1 tests

mysql-test/t/heap.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,17 @@ insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd
436436
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
437437
drop table t1;
438438

439+
#
440+
# Bug 12796: Record doesn't show when selecting through index
441+
#
442+
CREATE TABLE t1 (a int, key(a)) engine=heap;
443+
insert delayed into t1 values (0);
444+
delete from t1;
445+
select * from t1;
446+
insert delayed into t1 values (0), (1);
447+
select * from t1 where a = 0;
448+
drop table t1;
449+
439450
# End of 4.1 tests
440451

441452
#

mysql-test/t/kill.test

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ connect (con2, localhost, root,,);
1212
#remember id of con1
1313
connection con1;
1414
--disable_warnings
15-
drop table if exists t1;
15+
drop table if exists t1, t2, t3;
1616
--enable_warnings
1717

1818
--disable_reconnect
@@ -47,6 +47,53 @@ connection con2;
4747
select 4;
4848
drop table t1;
4949

50+
disconnect con2;
51+
connection default;
52+
#
53+
# BUG#14851: killing long running subquery processed via a temporary table.
54+
#
55+
create table t1 (id int primary key);
56+
create table t2 (id int unsigned not null);
57+
58+
connect (conn1, localhost, root,,);
59+
connection conn1;
60+
61+
-- disable_result_log
62+
-- disable_query_log
63+
let $1 = 4096;
64+
while ($1)
65+
{
66+
eval insert into t1 values ($1);
67+
dec $1;
68+
}
69+
-- enable_query_log
70+
-- enable_result_log
71+
72+
insert into t2 select id from t1;
73+
74+
create table t3 (kill_id int);
75+
insert into t3 values(connection_id());
76+
77+
-- disable_result_log
78+
send select id from t1 where id in (select distinct id from t2);
79+
-- enable_result_log
80+
81+
connect (conn2, localhost, root,,);
82+
connection conn2;
83+
select ((@id := kill_id) - kill_id) from t3;
84+
-- sleep 1
85+
kill @id;
86+
87+
connection conn1;
88+
-- error 1053
89+
reap;
90+
91+
disconnect conn1;
92+
disconnect conn2;
93+
connection default;
94+
95+
drop table t1, t2, t3;
96+
5097
# End of 4.1 tests
5198

5299
#

mysql-test/t/update.test

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,4 +287,23 @@ update t1 set f1=1 where f1=3;
287287
update t2,t1 set f1=3,f2=3 where f1=f2 and f1=1;
288288
--disable_info
289289
drop table t1,t2;
290+
291+
292+
# BUG#15935
293+
create table t1 (a int);
294+
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
295+
create table t2 (a int, filler1 char(200), filler2 char(200), key(a));
296+
insert into t2 select A.a + 10*B.a, 'filler','filler' from t1 A, t1 B;
297+
flush status;
298+
update t2 set a=3 where a=2;
299+
show status like 'handler_read%';
300+
drop table t1, t2;
301+
302+
#
303+
# Bug #16510 Updating field named like '*name' caused server crash
304+
#
305+
create table t1(f1 int, `*f2` int);
306+
insert into t1 values (1,1);
307+
update t1 set `*f2`=1;
308+
drop table t1;
290309
# End of 4.1 tests

ndb/include/mgmapi/mgmapi_config_parameters.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@
8585
#define CFG_DB_BACKUP_DATADIR 158
8686

8787
#define CFG_DB_MAX_OPEN_FILES 159
88+
#define CFG_DB_DISK_PAGE_BUFFER_MEMORY 160 /* used from 5.1 */
89+
#define CFG_DB_STRING_MEMORY 161 /* used from 5.1 */
90+
#define CFG_DB_INITIAL_OPEN_FILES 162 /* used from 5.1 */
91+
92+
#define CFG_DB_DATA_MEM_2 199 /* used in special build in 5.1 */
8893

8994
#define CFG_NODE_ARBIT_RANK 200
9095
#define CFG_NODE_ARBIT_DELAY 201

ndb/test/ndbapi/testBlobs.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,13 +1483,16 @@ testperf()
14831483
// insert char (one trans)
14841484
{
14851485
DBG("--- insert char ---");
1486+
char b[20];
14861487
t1.on();
14871488
CHK((g_con = g_ndb->startTransaction()) != 0);
14881489
for (Uint32 k = 0; k < g_opt.m_rowsperf; k++) {
14891490
CHK((g_opr = g_con->getNdbOperation(tab.getName())) != 0);
14901491
CHK(g_opr->insertTuple() == 0);
14911492
CHK(g_opr->equal(cA, (char*)&k) == 0);
1492-
CHK(g_opr->setValue(cB, "b") == 0);
1493+
memset(b, 0x20, sizeof(b));
1494+
b[0] = 'b';
1495+
CHK(g_opr->setValue(cB, b) == 0);
14931496
CHK(g_con->execute(NoCommit) == 0);
14941497
}
14951498
t1.off(g_opt.m_rowsperf);
@@ -1526,12 +1529,15 @@ testperf()
15261529
{
15271530
DBG("--- insert for read test ---");
15281531
unsigned n = 0;
1532+
char b[20];
15291533
CHK((g_con = g_ndb->startTransaction()) != 0);
15301534
for (Uint32 k = 0; k < g_opt.m_rowsperf; k++) {
15311535
CHK((g_opr = g_con->getNdbOperation(tab.getName())) != 0);
15321536
CHK(g_opr->insertTuple() == 0);
15331537
CHK(g_opr->equal(cA, (char*)&k) == 0);
1534-
CHK(g_opr->setValue(cB, "b") == 0);
1538+
memset(b, 0x20, sizeof(b));
1539+
b[0] = 'b';
1540+
CHK(g_opr->setValue(cB, b) == 0);
15351541
CHK((g_bh1 = g_opr->getBlobHandle(cC)) != 0);
15361542
CHK((g_bh1->setValue("c", 1) == 0));
15371543
if (++n == g_opt.m_batch) {
@@ -1565,7 +1571,7 @@ testperf()
15651571
a = (Uint32)-1;
15661572
b[0] = 0;
15671573
CHK(g_con->execute(NoCommit) == 0);
1568-
CHK(a == k && strcmp(b, "b") == 0);
1574+
CHK(a == k && b[0] == 'b');
15691575
}
15701576
CHK(g_con->execute(Commit) == 0);
15711577
t1.off(g_opt.m_rowsperf);
@@ -1591,7 +1597,7 @@ testperf()
15911597
CHK(g_con->execute(NoCommit) == 0);
15921598
Uint32 m = 20;
15931599
CHK(g_bh1->readData(c, m) == 0);
1594-
CHK(a == k && m == 1 && strcmp(c, "c") == 0);
1600+
CHK(a == k && m == 1 && c[0] == 'c');
15951601
}
15961602
CHK(g_con->execute(Commit) == 0);
15971603
t2.off(g_opt.m_rowsperf);
@@ -1623,7 +1629,7 @@ testperf()
16231629
CHK((ret = g_ops->nextResult(true)) == 0 || ret == 1);
16241630
if (ret == 1)
16251631
break;
1626-
CHK(a < g_opt.m_rowsperf && strcmp(b, "b") == 0);
1632+
CHK(a < g_opt.m_rowsperf && b[0] == 'b');
16271633
n++;
16281634
}
16291635
CHK(n == g_opt.m_rowsperf);
@@ -1654,7 +1660,7 @@ testperf()
16541660
break;
16551661
Uint32 m = 20;
16561662
CHK(g_bh1->readData(c, m) == 0);
1657-
CHK(a < g_opt.m_rowsperf && m == 1 && strcmp(c, "c") == 0);
1663+
CHK(a < g_opt.m_rowsperf && m == 1 && c[0] == 'c');
16581664
n++;
16591665
}
16601666
CHK(n == g_opt.m_rowsperf);

0 commit comments

Comments
 (0)