Loading mysql-test/r/ctype_utf8.result +16 −0 Original line number Diff line number Diff line Loading @@ -1293,6 +1293,22 @@ id tid val 42749 72 VOLN ADSL 44205 72 VOLN ADSL DROP TABLE t1; create table t1(a char(200) collate utf8_unicode_ci NOT NULL default '') default charset=utf8 collate=utf8_unicode_ci; insert into t1 values (unhex('65')), (unhex('C3A9')), (unhex('65')); explain select distinct a from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary select distinct a from t1; a e explain select a from t1 group by a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary; Using filesort select a from t1 group by a; a e drop table t1; CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8; INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa'); SELECT id FROM t1; Loading mysql-test/r/ndb_lock.result +12 −3 Original line number Diff line number Diff line Loading @@ -64,17 +64,26 @@ pk u o insert into t1 values (1,1,1); drop table t1; create table t1 (x integer not null primary key, y varchar(32), z integer, key(z)) engine = ndb; insert into t1 values (1,'one',1), (2,'two',2),(3,"three",3); insert into t1 values (1,'one',1); begin; select * from t1 where x = 1 for update; x y z 1 one 1 begin; select * from t1 where x = 2 for update; select * from t1 where x = 1 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction rollback; rollback; insert into t1 values (2,'two',2),(3,"three",3); begin; select * from t1 where x = 1 for update; x y z 2 two 2 1 one 1 select * from t1 where x = 1 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t1 where x = 2 for update; x y z 2 two 2 rollback; commit; begin; Loading mysql-test/t/ctype_utf8.test +14 −0 Original line number Diff line number Diff line Loading @@ -1037,6 +1037,20 @@ ALTER TABLE t1 ADD KEY idx (tid,val(11)); SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLN ADSL'; DROP TABLE t1; # # Bug 20709: problem with utf8 fields in temporary tables # create table t1(a char(200) collate utf8_unicode_ci NOT NULL default '') default charset=utf8 collate=utf8_unicode_ci; insert into t1 values (unhex('65')), (unhex('C3A9')), (unhex('65')); explain select distinct a from t1; select distinct a from t1; explain select a from t1 group by a; select a from t1 group by a; drop table t1; # End of 4.1 tests # Loading mysql-test/t/ndb_lock.test +13 −2 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ drop table t1; create table t1 (x integer not null primary key, y varchar(32), z integer, key(z)) engine = ndb; insert into t1 values (1,'one',1), (2,'two',2),(3,"three",3); insert into t1 values (1,'one',1); # PK access connection con1; Loading @@ -82,11 +82,22 @@ select * from t1 where x = 1 for update; connection con2; begin; select * from t1 where x = 2 for update; --error 1205 select * from t1 where x = 1 for update; rollback; connection con1; rollback; insert into t1 values (2,'two',2),(3,"three",3); begin; select * from t1 where x = 1 for update; connection con2; --error 1205 select * from t1 where x = 1 for update; select * from t1 where x = 2 for update; rollback; connection con1; commit; Loading ndb/include/ndbapi/NdbTransaction.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,7 @@ class NdbTransaction friend class NdbIndexOperation; friend class NdbIndexScanOperation; friend class NdbBlob; friend class ha_ndbcluster; #endif public: Loading Loading @@ -791,6 +792,7 @@ private: // optim: any blobs bool theBlobFlag; Uint8 thePendingBlobOps; inline bool hasBlobOperation() { return theBlobFlag; } static void sendTC_COMMIT_ACK(NdbApiSignal *, Uint32 transId1, Uint32 transId2, Loading Loading
mysql-test/r/ctype_utf8.result +16 −0 Original line number Diff line number Diff line Loading @@ -1293,6 +1293,22 @@ id tid val 42749 72 VOLN ADSL 44205 72 VOLN ADSL DROP TABLE t1; create table t1(a char(200) collate utf8_unicode_ci NOT NULL default '') default charset=utf8 collate=utf8_unicode_ci; insert into t1 values (unhex('65')), (unhex('C3A9')), (unhex('65')); explain select distinct a from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary select distinct a from t1; a e explain select a from t1 group by a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary; Using filesort select a from t1 group by a; a e drop table t1; CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8; INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa'); SELECT id FROM t1; Loading
mysql-test/r/ndb_lock.result +12 −3 Original line number Diff line number Diff line Loading @@ -64,17 +64,26 @@ pk u o insert into t1 values (1,1,1); drop table t1; create table t1 (x integer not null primary key, y varchar(32), z integer, key(z)) engine = ndb; insert into t1 values (1,'one',1), (2,'two',2),(3,"three",3); insert into t1 values (1,'one',1); begin; select * from t1 where x = 1 for update; x y z 1 one 1 begin; select * from t1 where x = 2 for update; select * from t1 where x = 1 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction rollback; rollback; insert into t1 values (2,'two',2),(3,"three",3); begin; select * from t1 where x = 1 for update; x y z 2 two 2 1 one 1 select * from t1 where x = 1 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction select * from t1 where x = 2 for update; x y z 2 two 2 rollback; commit; begin; Loading
mysql-test/t/ctype_utf8.test +14 −0 Original line number Diff line number Diff line Loading @@ -1037,6 +1037,20 @@ ALTER TABLE t1 ADD KEY idx (tid,val(11)); SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLN ADSL'; DROP TABLE t1; # # Bug 20709: problem with utf8 fields in temporary tables # create table t1(a char(200) collate utf8_unicode_ci NOT NULL default '') default charset=utf8 collate=utf8_unicode_ci; insert into t1 values (unhex('65')), (unhex('C3A9')), (unhex('65')); explain select distinct a from t1; select distinct a from t1; explain select a from t1 group by a; select a from t1 group by a; drop table t1; # End of 4.1 tests # Loading
mysql-test/t/ndb_lock.test +13 −2 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ drop table t1; create table t1 (x integer not null primary key, y varchar(32), z integer, key(z)) engine = ndb; insert into t1 values (1,'one',1), (2,'two',2),(3,"three",3); insert into t1 values (1,'one',1); # PK access connection con1; Loading @@ -82,11 +82,22 @@ select * from t1 where x = 1 for update; connection con2; begin; select * from t1 where x = 2 for update; --error 1205 select * from t1 where x = 1 for update; rollback; connection con1; rollback; insert into t1 values (2,'two',2),(3,"three",3); begin; select * from t1 where x = 1 for update; connection con2; --error 1205 select * from t1 where x = 1 for update; select * from t1 where x = 2 for update; rollback; connection con1; commit; Loading
ndb/include/ndbapi/NdbTransaction.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,7 @@ class NdbTransaction friend class NdbIndexOperation; friend class NdbIndexScanOperation; friend class NdbBlob; friend class ha_ndbcluster; #endif public: Loading Loading @@ -791,6 +792,7 @@ private: // optim: any blobs bool theBlobFlag; Uint8 thePendingBlobOps; inline bool hasBlobOperation() { return theBlobFlag; } static void sendTC_COMMIT_ACK(NdbApiSignal *, Uint32 transId1, Uint32 transId2, Loading