diff options
author | unknown <Sinisa@sinisa.nasamreza.org> | 2003-08-22 18:43:46 +0300 |
---|---|---|
committer | unknown <Sinisa@sinisa.nasamreza.org> | 2003-08-22 18:43:46 +0300 |
commit | 2d2f57654521df494afc41545322e0ebb0ec47a4 (patch) | |
tree | 6116b622fcbb528013b9fec903f0efd6927f75e2 /mysql-test/r | |
parent | 11fbbe44ac160a305d6ca452c6a14ef34a8282b9 (diff) | |
parent | e3563c7911580a34d423a154aaa0f9c99d01f45b (diff) | |
download | mariadb-git-2d2f57654521df494afc41545322e0ebb0ec47a4.tar.gz |
After merge fixes
mysql-test/r/func_test.result:
Auto merged
mysql-test/r/grant.result:
Auto merged
mysql-test/t/func_test.test:
Auto merged
mysql-test/t/grant.test:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
Diffstat (limited to 'mysql-test/r')
23 files changed, 572 insertions, 74 deletions
diff --git a/mysql-test/r/check_var_limit.require b/mysql-test/r/check_var_limit.require new file mode 100644 index 00000000000..01a59782180 --- /dev/null +++ b/mysql-test/r/check_var_limit.require @@ -0,0 +1,2 @@ +limit +1 diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 646c1a7bee2..737390865f1 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -256,3 +256,14 @@ select ref_mag from t1 where match ref_mag against ('+test' in boolean mode); ref_mag test drop table t1; +create table t1 (t1_id int(11) primary key, name varchar(32)); +insert into t1 values (1, 'data1'); +insert into t1 values (2, 'data2'); +create table t2 (t2_id int(11) primary key, t1_id int(11), name varchar(32)); +insert into t2 values (1, 1, 'xxfoo'); +insert into t2 values (2, 1, 'xxbar'); +insert into t2 values (3, 1, 'xxbuz'); +select * from t1 join t2 using(`t1_id`) where match (t1.name, t2.name) against('xxfoo' in boolean mode); +t1_id name t2_id t1_id name +1 data1 1 1 xxfoo +drop table t1,t2; diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result index b9d75189146..e11eaa0d246 100644 --- a/mysql-test/r/func_test.result +++ b/mysql-test/r/func_test.result @@ -46,6 +46,11 @@ select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL; 1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL 0 1 1 0 NULL NULL NULL +create table t1 (a int); +insert t1 values (1); +select * from t1 where 1 xor 1; +a +drop table t1; select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; 5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1 0 1 diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 8f9fa13a070..6ed5445233c 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -128,3 +128,6 @@ flush privileges; drop table t1; GRANT FILE on mysqltest.* to mysqltest_1@localhost; Wrong usage of DB GRANT and GLOBAL PRIVILEGES +select 1; +1 +1 diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 59153f3353a..0b7925de1c5 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -16,3 +16,13 @@ NULL NULL 0000-00-00 0000-00-00 NULL 0000-00-00 0000-00-00 0000-00-00 NULL 2003-03-03 2003-03-03 NULL drop table t1; +create table t1 (a text, b text); +load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; +select concat('|',a,'|'), concat('|',b,'|') from t1; +concat('|',a,'|') concat('|',b,'|') +|Field A| |Field B| +|Field 1| |Field 2' +Field 3,'Field 4| +|Field 5' ,'Field 6| NULL +|Field 6| | 'Field 7'| +drop table t1; diff --git a/mysql-test/r/mix_innodb_myisam_binlog.result b/mysql-test/r/mix_innodb_myisam_binlog.result new file mode 100644 index 00000000000..8a3415a81d0 --- /dev/null +++ b/mysql-test/r/mix_innodb_myisam_binlog.result @@ -0,0 +1,180 @@ +drop table if exists ti, tm; +create table ti (a int) type=innodb; +create table tm (a int) type=myisam; +reset master; +begin; +insert into ti values(1); +insert into tm select * from ti; +commit; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.001 79 Query 1 79 use test; BEGIN +master-bin.001 119 Query 1 79 use test; insert into ti values(1) +master-bin.001 178 Query 1 79 use test; insert into tm select * from ti +master-bin.001 244 Query 1 244 use test; COMMIT +delete from ti; +delete from tm; +reset master; +begin; +insert into ti values(2); +insert into tm select * from ti; +rollback; +Warning: Some non-transactional changed tables couldn't be rolled back +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.001 79 Query 1 79 use test; BEGIN +master-bin.001 119 Query 1 79 use test; insert into ti values(2) +master-bin.001 178 Query 1 79 use test; insert into tm select * from ti +master-bin.001 244 Query 1 244 use test; ROLLBACK +delete from ti; +delete from tm; +reset master; +begin; +insert into ti values(3); +savepoint my_savepoint; +insert into ti values(4); +insert into tm select * from ti; +rollback to savepoint my_savepoint; +Warning: Some non-transactional changed tables couldn't be rolled back +commit; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.001 79 Query 1 79 use test; BEGIN +master-bin.001 119 Query 1 79 use test; insert into ti values(3) +master-bin.001 178 Query 1 79 use test; savepoint my_savepoint +master-bin.001 235 Query 1 79 use test; insert into ti values(4) +master-bin.001 294 Query 1 79 use test; insert into tm select * from ti +master-bin.001 360 Query 1 79 use test; rollback to savepoint my_savepoint +master-bin.001 429 Query 1 429 use test; COMMIT +delete from ti; +delete from tm; +reset master; +begin; +insert into ti values(5); +savepoint my_savepoint; +insert into ti values(6); +insert into tm select * from ti; +rollback to savepoint my_savepoint; +Warning: Some non-transactional changed tables couldn't be rolled back +insert into ti values(7); +commit; +select a from ti order by a; +a +5 +7 +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.001 79 Query 1 79 use test; BEGIN +master-bin.001 119 Query 1 79 use test; insert into ti values(5) +master-bin.001 178 Query 1 79 use test; savepoint my_savepoint +master-bin.001 235 Query 1 79 use test; insert into ti values(6) +master-bin.001 294 Query 1 79 use test; insert into tm select * from ti +master-bin.001 360 Query 1 79 use test; rollback to savepoint my_savepoint +master-bin.001 429 Query 1 79 use test; insert into ti values(7) +master-bin.001 488 Query 1 488 use test; COMMIT +delete from ti; +delete from tm; +reset master; +select get_lock("a",10); +get_lock("a",10) +1 +begin; +insert into ti values(8); +insert into tm select * from ti; +select get_lock("a",10); +get_lock("a",10) +1 +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.001 79 Query 1 79 use test; BEGIN +master-bin.001 119 Query 1 79 use test; insert into ti values(8) +master-bin.001 178 Query 1 79 use test; insert into tm select * from ti +master-bin.001 244 Query 1 244 use test; ROLLBACK +delete from ti; +delete from tm; +reset master; +insert into ti values(9); +insert into tm select * from ti; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.001 79 Query 1 79 use test; insert into ti values(9) +master-bin.001 138 Query 1 138 use test; insert into tm select * from ti +delete from ti; +delete from tm; +reset master; +insert into ti values(10); +begin; +insert into tm select * from ti; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.001 79 Query 1 79 use test; insert into ti values(10) +master-bin.001 139 Query 1 139 use test; insert into tm select * from ti +insert into ti values(11); +commit; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.001 79 Query 1 79 use test; insert into ti values(10) +master-bin.001 139 Query 1 139 use test; insert into tm select * from ti +master-bin.001 205 Query 1 205 use test; BEGIN +master-bin.001 245 Query 1 205 use test; insert into ti values(11) +master-bin.001 305 Query 1 305 use test; COMMIT +alter table tm type=INNODB; +delete from ti; +delete from tm; +reset master; +begin; +insert into ti values(12); +insert into tm select * from ti; +commit; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.001 79 Query 1 79 use test; BEGIN +master-bin.001 119 Query 1 79 use test; insert into ti values(12) +master-bin.001 179 Query 1 79 use test; insert into tm select * from ti +master-bin.001 245 Query 1 245 use test; COMMIT +delete from ti; +delete from tm; +reset master; +begin; +insert into ti values(13); +insert into tm select * from ti; +rollback; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +delete from ti; +delete from tm; +reset master; +begin; +insert into ti values(14); +savepoint my_savepoint; +insert into ti values(15); +insert into tm select * from ti; +rollback to savepoint my_savepoint; +commit; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.001 79 Query 1 79 use test; BEGIN +master-bin.001 119 Query 1 79 use test; insert into ti values(14) +master-bin.001 179 Query 1 179 use test; COMMIT +delete from ti; +delete from tm; +reset master; +begin; +insert into ti values(16); +savepoint my_savepoint; +insert into ti values(17); +insert into tm select * from ti; +rollback to savepoint my_savepoint; +insert into ti values(18); +commit; +select a from ti order by a; +a +16 +18 +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.001 79 Query 1 79 use test; BEGIN +master-bin.001 119 Query 1 79 use test; insert into ti values(16) +master-bin.001 179 Query 1 79 use test; insert into ti values(18) +master-bin.001 239 Query 1 239 use test; COMMIT +drop table ti,tm; diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index 65b882c0a9b..f6c7bf5bc79 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -3,8 +3,8 @@ create table t1(f1 int); insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user2@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com"; -grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com" ISSUER "/C=RU/ST=Some-State/L=Orenburg/O=MySQL AB/CN=Walrus/Email=walrus@mysql.com"; +grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; flush privileges; select * from t1; f1 diff --git a/mysql-test/r/packet.result b/mysql-test/r/packet.result index e994e4d63da..6733f2b142e 100644 --- a/mysql-test/r/packet.result +++ b/mysql-test/r/packet.result @@ -5,12 +5,12 @@ set net_buffer_length=100; SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; len 1024 -select repeat('a',200); -repeat('a',200) +select repeat('a',2000); +repeat('a',2000) NULL select @@net_buffer_length, @@max_allowed_packet; @@net_buffer_length @@max_allowed_packet -1024 80 +1024 1024 SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; Got a packet bigger than 'max_allowed_packet' set global max_allowed_packet=default; @@ -20,6 +20,6 @@ set net_buffer_length=default; SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; len 100 -select length(repeat('a',200)); -length(repeat('a',200)) -200 +select length(repeat('a',2000)); +length(repeat('a',2000)) +2000 diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 0ef0cab423b..0b86c79afbf 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -2,7 +2,7 @@ flush query cache; flush query cache; reset query cache; flush status; -drop table if exists t1,t2,t3,t11,t21, mysqltest.t1; +drop table if exists t1,t2,t3; drop database if exists mysqltest; create table t1 (a int not null); insert into t1 values (1),(2),(3); diff --git a/mysql-test/r/query_cache_merge.result b/mysql-test/r/query_cache_merge.result new file mode 100644 index 00000000000..c6df4266de2 --- /dev/null +++ b/mysql-test/r/query_cache_merge.result @@ -0,0 +1,20 @@ +SET @@global.query_cache_size=1355776; +flush status; +select count(*) from t00; +count(*) +514 +select count(*) from t00; +count(*) +514 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 1 +delete from t256; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t257,t00; +SET @@global.query_cache_size=0; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 26d9d7869c6..5da6f6c30e1 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -226,3 +226,31 @@ insert into t1 values (0,1,NULL,"aaa"), (1,1,NULL,"aaa"), (2,1,NULL,"aaa"), select a.id1, b.idnull from t1 as a, t1 as b where a.id2=1 and a.id1=1 and b.id1=a.idnull order by b.id2 desc limit 1; id1 idnull drop table t1; +create table t1 (x int, y int, index(x), index(y)); +insert into t1 (x) values (1),(2),(3),(4),(5),(6),(7),(8),(9); +update t1 set y=x; +explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 7 and t1.y+0; +table type possible_keys key key_len ref rows Extra +t1 ref y y 5 const 1 Using where +t2 range x x 5 NULL 4 Using where +explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 7 and t2.x <= t1.y+0; +table type possible_keys key key_len ref rows Extra +t1 ref y y 5 const 1 Using where +t2 range x x 5 NULL 4 Using where +explain select * from t1, t1 t2 where t1.y = 2 and t2.x between t1.y-1 and t1.y+1; +table type possible_keys key key_len ref rows Extra +t1 ref y y 5 const 1 Using where +t2 ALL x NULL NULL NULL 9 Range checked for each record (index map: 1) +explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= t1.y-1 and t2.x <= t1.y+1; +table type possible_keys key key_len ref rows Extra +t1 ref y y 5 const 1 Using where +t2 ALL x NULL NULL NULL 9 Range checked for each record (index map: 1) +explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 0 and t1.y; +table type possible_keys key key_len ref rows Extra +t1 ref y y 5 const 1 Using where +t2 ALL x NULL NULL NULL 9 Using where +explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 0 and t2.x <= t1.y; +table type possible_keys key key_len ref rows Extra +t1 ref y y 5 const 1 Using where +t2 range x x 5 NULL 2 Using where +drop table t1; diff --git a/mysql-test/r/rpl_do_grant.result b/mysql-test/r/rpl_do_grant.result new file mode 100644 index 00000000000..fec935ae7ac --- /dev/null +++ b/mysql-test/r/rpl_do_grant.result @@ -0,0 +1,26 @@ +slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +slave start; +delete from mysql.user where user='rpl_do_grant'; +delete from mysql.db where user='rpl_do_grant'; +flush privileges; +delete from mysql.user where user='rpl_ignore_grant'; +delete from mysql.db where user='rpl_ignore_grant'; +flush privileges; +grant select on *.* to rpl_do_grant@localhost; +grant drop on test.* to rpl_do_grant@localhost; +show grants for rpl_do_grant@localhost; +Grants for rpl_do_grant@localhost +GRANT SELECT ON *.* TO 'rpl_do_grant'@'localhost' +GRANT DROP ON `test`.* TO 'rpl_do_grant'@'localhost' +set password for rpl_do_grant@localhost=password("does it work?"); +select password<>'' from mysql.user where user='rpl_do_grant'; +password<>'' +1 +delete from mysql.user where user='rpl_do_grant'; +delete from mysql.db where user='rpl_do_grant'; +flush privileges; +flush privileges; diff --git a/mysql-test/r/rpl_ignore_grant.result b/mysql-test/r/rpl_ignore_grant.result new file mode 100644 index 00000000000..6cd7d5b4c00 --- /dev/null +++ b/mysql-test/r/rpl_ignore_grant.result @@ -0,0 +1,37 @@ +slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +slave start; +delete from mysql.user where user='rpl_ignore_grant'; +delete from mysql.db where user='rpl_ignore_grant'; +flush privileges; +delete from mysql.user where user='rpl_ignore_grant'; +delete from mysql.db where user='rpl_ignore_grant'; +flush privileges; +grant select on *.* to rpl_ignore_grant@localhost; +grant drop on test.* to rpl_ignore_grant@localhost; +show grants for rpl_ignore_grant@localhost; +Grants for rpl_ignore_grant@localhost +GRANT SELECT ON *.* TO 'rpl_ignore_grant'@'localhost' +GRANT DROP ON `test`.* TO 'rpl_ignore_grant'@'localhost' +show grants for rpl_ignore_grant@localhost; +There is no such grant defined for user 'rpl_ignore_grant' on host 'localhost' +select count(*) from mysql.user where user='rpl_ignore_grant'; +count(*) +0 +select count(*) from mysql.db where user='rpl_ignore_grant'; +count(*) +0 +grant select on *.* to rpl_ignore_grant@localhost; +set password for rpl_ignore_grant@localhost=password("does it work?"); +select password<>'' from mysql.user where user='rpl_ignore_grant'; +password<>'' +0 +delete from mysql.user where user='rpl_ignore_grant'; +delete from mysql.db where user='rpl_ignore_grant'; +flush privileges; +delete from mysql.user where user='rpl_ignore_grant'; +delete from mysql.db where user='rpl_ignore_grant'; +flush privileges; diff --git a/mysql-test/r/rpl_insert_id.result b/mysql-test/r/rpl_insert_id.result index 0065d83f169..889e7891770 100644 --- a/mysql-test/r/rpl_insert_id.result +++ b/mysql-test/r/rpl_insert_id.result @@ -21,8 +21,8 @@ b c 1 4 drop table t1; drop table t2; -create table t1(a int auto_increment, key(a)); -create table t2(b int auto_increment, c int, key(b)); +create table t1(a int auto_increment, key(a)) type=innodb; +create table t2(b int auto_increment, c int, key(b), foreign key(b) references t1(a)) type=innodb; SET FOREIGN_KEY_CHECKS=0; insert into t1 values (10); insert into t1 values (null),(null),(null); diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/r/rpl_loaddata.result index b5154ca95cf..0302381c119 100644 --- a/mysql-test/r/rpl_loaddata.result +++ b/mysql-test/r/rpl_loaddata.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; slave start; +reset master; create table t1(a int not null auto_increment, b int, primary key(a) ); load data infile '../../std_data/rpl_loaddata.dat' into table t1; create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60)); @@ -19,9 +20,38 @@ day id category name 2003-02-22 2461 b a a a @ % ' " a 2003-03-22 2161 c asdf 2003-04-22 2416 a bbbbb +show master status; +File Position Binlog_do_db Binlog_ignore_db +slave-bin.001 964 drop table t1; drop table t2; drop table t3; create table t1(a int, b int, unique(b)); insert into t1 values(1,10); load data infile '../../std_data/rpl_loaddata.dat' into table t1; +set global sql_slave_skip_counter=1; +start slave; +show slave status; +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space +127.0.0.1 root MASTER_PORT 1 master-bin.001 1311 slave-relay-bin.002 1352 master-bin.001 Yes Yes 0 0 1311 1352 +set sql_log_bin=0; +delete from t1; +set sql_log_bin=1; +load data infile '../../std_data/rpl_loaddata.dat' into table t1; +stop slave; +change master to master_user='test'; +change master to master_user='root'; +show slave status; +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space +127.0.0.1 root MASTER_PORT 1 master-bin.001 1442 slave-relay-bin.001 4 master-bin.001 No No 0 0 1442 4 +set global sql_slave_skip_counter=1; +start slave; +set sql_log_bin=0; +delete from t1; +set sql_log_bin=1; +load data infile '../../std_data/rpl_loaddata.dat' into table t1; +stop slave; +reset slave; +show slave status; +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space +127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.001 4 No No 0 0 0 4 diff --git a/mysql-test/r/rpl_loaddata_rule_m.result b/mysql-test/r/rpl_loaddata_rule_m.result new file mode 100644 index 00000000000..8d8ed749c71 --- /dev/null +++ b/mysql-test/r/rpl_loaddata_rule_m.result @@ -0,0 +1,14 @@ +slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +slave start; +reset master; +create database test2; +create table t1(a int, b int, unique(b)); +use test2; +load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +drop database test2; diff --git a/mysql-test/r/rpl_loaddata_rule_s.result b/mysql-test/r/rpl_loaddata_rule_s.result new file mode 100644 index 00000000000..a84368501a9 --- /dev/null +++ b/mysql-test/r/rpl_loaddata_rule_s.result @@ -0,0 +1,14 @@ +slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +slave start; +reset master; +create table t1(a int, b int, unique(b)); +load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; +select count(*) from t1; +count(*) +2 +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info diff --git a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result index 640e6f02103..26e465f9c3b 100644 --- a/mysql-test/r/rpl_log.result +++ b/mysql-test/r/rpl_log.result @@ -12,7 +12,10 @@ create table t1(n int not null auto_increment primary key); insert into t1 values (NULL); drop table t1; create table t1 (word char(20) not null); -load data infile '../../std_data/words.dat' into table t1; +load data infile '../../std_data/words.dat' into table t1 ignore 1 lines; +select count(*) from t1; +count(*) +69 drop table t1; show binlog events; Log_name Pos Event_type Server_id Orig_log_pos Info @@ -81,16 +84,16 @@ slave-bin.001 200 Query 1 200 use test; insert into t1 values (NULL) slave-bin.001 263 Query 1 263 use test; drop table t1 slave-bin.001 311 Query 1 311 use test; create table t1 (word char(20) not null) slave-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581 -slave-bin.001 1065 Exec_load 1 1056 ;file_id=1 -slave-bin.001 1088 Query 1 1079 use test; drop table t1 -slave-bin.001 1136 Query 1 4 use test; create table t5 (a int) -slave-bin.001 1194 Query 1 62 use test; drop table t5 +slave-bin.001 1065 Exec_load 1 1065 ;file_id=1 +slave-bin.001 1088 Query 1 1088 use test; drop table t1 +slave-bin.001 1136 Query 1 1136 use test; create table t5 (a int) +slave-bin.001 1194 Query 1 1194 use test; drop table t5 slave-bin.001 1242 Rotate 2 1242 slave-bin.002;pos=4 show binlog events in 'slave-bin.002' from 4; Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.002 4 Query 1 110 use test; create table t1 (n int) -slave-bin.002 62 Query 1 168 use test; insert into t1 values (1) -slave-bin.002 122 Query 1 228 use test; drop table t1 +slave-bin.002 4 Query 1 4 use test; create table t1 (n int) +slave-bin.002 62 Query 1 62 use test; insert into t1 values (1) +slave-bin.002 122 Query 1 122 use test; drop table t1 show slave status; Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space 127.0.0.1 root MASTER_PORT 1 master-bin.002 276 slave-relay-bin.003 211 master-bin.002 Yes Yes 0 0 276 211 diff --git a/mysql-test/r/rpl_reset_slave.result b/mysql-test/r/rpl_reset_slave.result new file mode 100644 index 00000000000..c1bc1e8e483 --- /dev/null +++ b/mysql-test/r/rpl_reset_slave.result @@ -0,0 +1,22 @@ +slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +slave start; +show slave status; +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space +127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 120 +stop slave; +change master to master_user='test'; +show slave status; +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space +127.0.0.1 test MASTER_PORT 1 master-bin.001 79 slave-relay-bin.001 4 master-bin.001 No No 0 0 79 4 +reset slave; +show slave status; +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space +127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.001 4 No No 0 0 0 4 +start slave; +show slave status; +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space +127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 120 diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 811c396ea67..bde527b9b44 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3508,3 +3508,23 @@ aa id t2_id id 5 8303 2520 2520 6 8304 2521 2521 drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +table type possible_keys key key_len ref rows Extra +t3 system NULL NULL NULL NULL 0 const row not found +t1 ALL NULL NULL NULL NULL 2 +t2 ALL NULL NULL NULL NULL 1 +t4 ALL id4 NULL NULL NULL 1 Using where +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; diff --git a/mysql-test/r/select_safe.result b/mysql-test/r/select_safe.result index ca5c03bdb50..c4e5984d360 100644 --- a/mysql-test/r/select_safe.result +++ b/mysql-test/r/select_safe.result @@ -67,12 +67,12 @@ analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status OK insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"); -explain select * from t1,t1 as t2 where t1.b=t2.b; +explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; table type possible_keys key key_len ref rows Extra t1 ALL b NULL NULL NULL 21 t2 ALL b NULL NULL NULL 16 Using where set MAX_SEEKS_FOR_KEY=1; -explain select * from t1,t1 as t2 where t1.b=t2.b; +explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; table type possible_keys key key_len ref rows Extra t1 ALL b NULL NULL NULL 21 t2 ref b b 21 t1.b 6 Using where diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 214328eab47..8dfe14bc1a2 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -32,6 +32,8 @@ datum 2000-01-02 2000-01-03 2000-01-04 +SELECT * FROM t1 WHERE datum BETWEEN "2000-1-2" AND datum - INTERVAL 100 DAY; +datum DROP TABLE t1; CREATE TABLE t1 ( user_id char(10), diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 50f689e3e4b..9899b8279e2 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -295,57 +295,128 @@ a b 5 f 6 e drop table t1,t2,t3,t4; -CREATE TABLE t1 ( `IdUser` int(11) NOT NULL default '0', `IdDirectMessage` int(11) NOT NULL default '0', `Readed` datetime default NULL, PRIMARY KEY (`IdUser`,`IdDirectMessage`), KEY `IdDirectMessage` (`IdDirectMessage`), ); -CREATE TABLE t2 ( `IdDirectMessage` int(11) NOT NULL default '0', `MessageData` text NOT NULL, `DateOfMessage` datetime default NULL, PRIMARY KEY (`IdDirectMessage`) ); -INSERT INTO t2 (`IdDirectMessage`, `MessageData`, `DateOfMessage`) VALUES (1,'Texto','2003-08-06 00:00:00'), (2,'Texto','2003-08-06 00:00:00'), (3,'Texto','2003-08-06 00:00:00'), (4,'Texto','2003-08-06 00:00:00'), (5,'Texto','2003-08-06 00:00:00'), (6,'Texto','2003-08-06 00:00:00'), (7,'Texto','2003-08-06 00:00:00'), (8,'Texto','2003-08-06 00:00:00'), (9,'Texto','2003-08-06 00:00:00'), (10,'Texto','2003-08-06 00:00:00'), (11,'Texto','2003-08-06 00:00:00'), (12,'Texto','2003-08-06 00:00:00'), (13,'Texto','2003-08-06 00:00:00'), (14,'Texto','2003-08-06 00:00:00'), (15,'Texto','2003-08-06 00:00:00'), (16,'Texto','2003-08-06 00:00:00'), (17,'Texto','2003-08-06 00:00:00'), (18,'Texto','2003-08-06 00:00:00'), (19,'Texto','2003-08-06 00:00:00'), (20,'Texto','2003-08-06 00:00:00'), (21,'Texto','2003-08-06 00:00:00'), (22,'Texto','2003-08-06 00:00:00'); -INSERT INTO t1 (`IdUser`, `IdDirectMessage`, `Readed`) VALUES (4,1,'2003-08-07 10:10:13'), (4,2,'2003-08-07 10:10:13'), (4,3,'2003-08-07 10:10:13'), (4,4,'2003-08-07 10:10:13'), (4,5,'2003-08-07 10:10:13'), (4,6,'2003-08-07 10:10:13'), (4,7,'2003-08-07 10:10:13'), (4,8,'2003-08-07 10:10:13'), (4,9,'2003-08-07 10:10:13'), (4,10,'2003-08-07 10:10:13'), (4,11,'2003-08-07 10:10:13'), (4,12,'2003-08-07 10:10:13'), (4,13,'2003-08-07 10:10:13'), (4,14,'2003-08-07 10:10:13'), (4,15,'2003-08-07 10:10:13'), (4,16,'2003-08-07 10:10:13'), (4,17,'2003-08-07 10:10:13'), (4,18,'2003-08-07 10:10:13'), (4,19,'2003-08-07 10:10:13'), (4,20,'2003-08-07 10:10:13'), (4,21,'2003-08-06 16:51:04'), (4,22,'2003-08-06 16:51:19'); -SELECT SQL_CALC_FOUND_ROWS t2.* FROM t2 INNER JOIN t1 ON t2.IdDirectMessage = t1.IdDirectMessage WHERE IdUser = 4 AND Readed Is NULL UNION SELECT t2.* FROM t2 INNER JOIN t1 ON t2.IdDirectMessage = t1.IdDirectMessage WHERE IdUser = 4 AND NOT (t1.Readed is NULL) ORDER BY DateOfMessage Limit 0,2; -IdDirectMessage MessageData DateOfMessage -1 Texto 2003-08-06 00:00:00 -2 Texto 2003-08-06 00:00:00 -SELECT FOUND_ROWS(); -FOUND_ROWS() -22 -SELECT SQL_CALC_FOUND_ROWS t2.* FROM t2 INNER JOIN t1 ON t2.IdDirectMessage = t1.IdDirectMessage WHERE IdUser = 4 AND Readed Is NULL UNION ALL SELECT t2.* FROM t2 INNER JOIN t1 ON t2.IdDirectMessage = t1.IdDirectMessage WHERE IdUser = 4 AND NOT (t1.Readed is NULL) ORDER BY DateOfMessage Limit 0,2; -IdDirectMessage MessageData DateOfMessage -1 Texto 2003-08-06 00:00:00 -2 Texto 2003-08-06 00:00:00 -SELECT FOUND_ROWS(); -FOUND_ROWS() -22 -SELECT SQL_CALC_FOUND_ROWS t2.* FROM t2 INNER JOIN t1 ON t2.IdDirectMessage = t1.IdDirectMessage WHERE IdUser = 4 AND Readed Is NULL limit 1 UNION SELECT t2.* FROM t2 INNER JOIN t1 ON t2.IdDirectMessage = t1.IdDirectMessage WHERE IdUser = 4 AND NOT (t1.Readed is NULL) ORDER BY DateOfMessage; -IdDirectMessage MessageData DateOfMessage -1 Texto 2003-08-06 00:00:00 -2 Texto 2003-08-06 00:00:00 -3 Texto 2003-08-06 00:00:00 -4 Texto 2003-08-06 00:00:00 -5 Texto 2003-08-06 00:00:00 -6 Texto 2003-08-06 00:00:00 -7 Texto 2003-08-06 00:00:00 -8 Texto 2003-08-06 00:00:00 -9 Texto 2003-08-06 00:00:00 -10 Texto 2003-08-06 00:00:00 -11 Texto 2003-08-06 00:00:00 -12 Texto 2003-08-06 00:00:00 -13 Texto 2003-08-06 00:00:00 -14 Texto 2003-08-06 00:00:00 -15 Texto 2003-08-06 00:00:00 -16 Texto 2003-08-06 00:00:00 -17 Texto 2003-08-06 00:00:00 -18 Texto 2003-08-06 00:00:00 -19 Texto 2003-08-06 00:00:00 -20 Texto 2003-08-06 00:00:00 -21 Texto 2003-08-06 00:00:00 -22 Texto 2003-08-06 00:00:00 -SELECT FOUND_ROWS(); -FOUND_ROWS() -22 -drop table t2,t1; -CREATE TABLE t1 ( sid int(11) NOT NULL default '0', nazwa char(10) NOT NULL default '', PRIMARY KEY (sid) ) TYPE=MyISAM; -CREATE TABLE t2 ( id int(11) NOT NULL default '0', link int(11) default NULL, bubu char(10) NOT NULL default '', PRIMARY KEY (id) ) TYPE=MyISAM; -INSERT INTO t2 VALUES (1,2,'keke'); -SELECT bubu, nazwa, bubu FROM t2 LEFT JOIN t1 ON sid = link WHERE id=1 UNION SELECT 'bu', null, 'bu'; -bubu nazwa bubu -keke NULL keke -bu NULL bu +create table t1 (a int); +insert into t1 values (1),(2),(3); +create table t2 (a int); +insert into t2 values (3),(4),(5); +(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2) LIMIT 1; +a +1 +select found_rows(); +found_rows() +6 +(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2) LIMIT 2; +a +1 +3 +select found_rows(); +found_rows() +4 +(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2); +a +1 +3 +4 +5 +select found_rows(); +found_rows() +4 +(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2 LIMIT 1); +a +1 +2 +3 +3 +select found_rows(); +found_rows() +4 +(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1; +a +1 +select found_rows(); +found_rows() +4 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2; +a +1 +3 +select found_rows(); +found_rows() +6 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION all SELECT * FROM t2 LIMIT 2; +a +1 +2 +select found_rows(); +found_rows() +6 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2; +a +1 +2 +select found_rows(); +found_rows() +6 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 100; +a +1 +2 +3 +4 +5 +select found_rows(); +found_rows() +6 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 100 UNION SELECT * FROM t2; +a +1 +2 +3 +4 +5 +select found_rows(); +found_rows() +5 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2; +a +1 +3 +4 +5 +select found_rows(); +found_rows() +6 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2 LIMIT 2; +a +1 +3 +select found_rows(); +found_rows() +6 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2,2; +a +3 +4 +select found_rows(); +found_rows() +6 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 limit 2,2 UNION SELECT * FROM t2; +a +3 +4 +5 +select found_rows(); +found_rows() +5 +SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a desc LIMIT 1; +a +5 +(SELECT * FROM t1 ORDER by a) UNION ALL (SELECT * FROM t2 ORDER BY a) ORDER BY A desc LIMIT 4; +a +5 +4 +3 +3 +(SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1; +Wrong usage/placement of 'SQL_CALC_FOUND_ROWS' drop table t1,t2; |