summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-11-04 15:06:24 +0200
committerunknown <monty@mysql.com>2004-11-04 15:06:24 +0200
commit70d66da883b1d4bc5a9c22737461aba40023d8ff (patch)
tree9d4d27a72c18ead47fb83bd5ec0e2383cdd34ff6 /mysql-test/r
parentf662de31e8441a4803b3487ef264a35695820a77 (diff)
parentc9a75ccf1acfc4578496a1606fcf009301366997 (diff)
downloadmariadb-git-70d66da883b1d4bc5a9c22737461aba40023d8ff.tar.gz
Merge with 4.1 to get in latest bug fixes
BitKeeper/etc/logging_ok: auto-union Docs/Support/texi2html: Auto merged include/mysql.h: Auto merged include/mysql_com.h: Auto merged libmysql/libmysql.c: Auto merged myisam/mi_check.c: Auto merged myisam/myisamchk.c: Auto merged mysql-test/include/ps_modify.inc: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/ctype_recoding.result: Auto merged mysql-test/r/fulltext.result: Auto merged mysql-test/r/gis.result: Auto merged mysql-test/r/ndb_blob.result: Auto merged mysql-test/r/ps_2myisam.result: Auto merged mysql-test/r/ps_3innodb.result: Auto merged mysql-test/r/ps_4heap.result: Auto merged mysql-test/r/ps_5merge.result: Auto merged mysql-test/r/ps_6bdb.result: Auto merged mysql-test/r/sql_mode.result: Auto merged mysql-test/t/join_outer.test: Auto merged mysql-test/t/key.test: Auto merged mysql-test/t/range.test: Auto merged mysql-test/t/show_check.test: Auto merged mysql-test/t/sql_mode.test: Auto merged sql/field.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/item.h: Auto merged sql/item_create.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/mysqld.cc: Auto merged sql/net_serv.cc: Auto merged sql/protocol.cc: Auto merged sql/protocol.h: Auto merged sql/sql_class.cc: Auto merged sql/sql_handler.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_string.cc: Auto merged sql/sql_string.h: Auto merged sql/sql_table.cc: Auto merged client/mysqltest.c: Merge with 4.1 mysql-test/r/range.result: Merge with 4.1 Added missing drop table test sql/ha_innodb.cc: Merge with 4.1 sql/item.cc: Merge with 4.1 sql/item_cmpfunc.cc: Merge with 4.1 sql/opt_range.cc: Merge with 4.1 sql/sql_prepare.cc: Merge with 4.1 tests/client_test.c: Merge with 4.1 Added code to support --silent configure.in: Merge with 4.1 ndb/src/common/util/version.c: Merge with 4.1
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/ctype_recoding.result66
-rw-r--r--mysql-test/r/ctype_sjis.result11
-rw-r--r--mysql-test/r/fulltext.result3
-rw-r--r--mysql-test/r/gis.result74
-rw-r--r--mysql-test/r/mysqltest.result131
-rw-r--r--mysql-test/r/ndb_basic.result147
-rw-r--r--mysql-test/r/ndb_blob.result276
-rw-r--r--mysql-test/r/ndb_insert.result29
-rw-r--r--mysql-test/r/ps_10nestset.result11
-rw-r--r--mysql-test/r/ps_2myisam.result4
-rw-r--r--mysql-test/r/ps_3innodb.result4
-rw-r--r--mysql-test/r/ps_4heap.result4
-rw-r--r--mysql-test/r/ps_5merge.result8
-rw-r--r--mysql-test/r/ps_6bdb.result4
-rw-r--r--mysql-test/r/ps_7ndb.result1
-rw-r--r--mysql-test/r/range.result17
-rw-r--r--mysql-test/r/rpl_failed_optimize.result15
-rw-r--r--mysql-test/r/sql_mode.result30
18 files changed, 717 insertions, 118 deletions
diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result
index 78d15c21301..7d5f9d5b59a 100644
--- a/mysql-test/r/ctype_recoding.result
+++ b/mysql-test/r/ctype_recoding.result
@@ -174,3 +174,69 @@ Warnings:
Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'b' at row 1
drop table t1;
+set names koi8r;
+create table t1 (a char(10) character set cp1251);
+insert into t1 values (_koi8r'����');
+select * from t1 where a=_koi8r'����';
+a
+����
+select * from t1 where a=concat(_koi8r'����');
+ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation '='
+select * from t1 where a=_latin1'����';
+ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='
+drop table t1;
+set names latin1;
+set names koi8r;
+create table t1 (c1 char(10) character set cp1251);
+insert into t1 values ('�');
+select c1 from t1 where c1 between '�' and '�';
+c1
+�
+select ifnull(c1,'�'), ifnull(null,c1) from t1;
+ifnull(c1,'�') ifnull(null,c1)
+� �
+select if(1,c1,'�'), if(0,c1,'�') from t1;
+if(1,c1,'�') if(0,c1,'�')
+� �
+select coalesce('�',c1), coalesce(null,c1) from t1;
+coalesce('�',c1) coalesce(null,c1)
+� �
+select least(c1,'�'), greatest(c1,'�') from t1;
+least(c1,'�') greatest(c1,'�')
+� �
+select locate(c1,'�'), locate('�',c1) from t1;
+locate(c1,'�') locate('�',c1)
+1 1
+select field(c1,'�'),field('�',c1) from t1;
+field(c1,'�') field('�',c1)
+1 1
+select concat(c1,'�'), concat('�',c1) from t1;
+concat(c1,'�') concat('�',c1)
+�� ��
+select concat_ws(c1,'�','�'), concat_ws('�',c1,'�') from t1;
+concat_ws(c1,'�','�') concat_ws('�',c1,'�')
+��� ���
+select replace(c1,'�','�'), replace('�',c1,'�') from t1;
+replace(c1,'�','�') replace('�',c1,'�')
+� �
+select substring_index(c1,'����',2) from t1;
+substring_index(c1,'����',2)
+�
+select elt(1,c1,'�'),elt(1,'�',c1) from t1;
+elt(1,c1,'�') elt(1,'�',c1)
+� �
+select make_set(3,c1,'�'), make_set(3,'�',c1) from t1;
+make_set(3,c1,'�') make_set(3,'�',c1)
+�,� �,�
+select insert(c1,1,2,'�'),insert('�',1,2,c1) from t1;
+insert(c1,1,2,'�') insert('�',1,2,c1)
+� �
+select trim(c1 from '�'),trim('�' from c1) from t1;
+trim(c1 from '�') trim('�' from c1)
+
+select lpad(c1,3,'�'), lpad('�',3,c1) from t1;
+lpad(c1,3,'�') lpad('�',3,c1)
+��� ���
+select rpad(c1,3,'�'), rpad('�',3,c1) from t1;
+rpad(c1,3,'�') rpad('�',3,c1)
+��� ���
diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result
index b0edbed1a41..944fa0602a9 100644
--- a/mysql-test/r/ctype_sjis.result
+++ b/mysql-test/r/ctype_sjis.result
@@ -60,3 +60,14 @@ hex(c)
9353
9373
drop table t1;
+SET NAMES sjis;
+CREATE TABLE t1 (
+c char(16) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=sjis;
+insert into t1 values(0xb1),(0xb2),(0xb3);
+select hex(c) from t1;
+hex(c)
+B1
+B2
+B3
+drop table t1;
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 3f4766830b0..ba2403bac21 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -330,6 +330,9 @@ t1_id name t2_id t1_id name
select * from t2 where match name against ('a* b* c* d* e* f*' in boolean mode);
t2_id t1_id name
drop table t1,t2;
+create table t1 (a text, fulltext key (a));
+insert into t1 select "xxxx yyyy zzzz";
+drop table t1;
SET NAMES latin1;
CREATE TABLE t1 (t text character set utf8 not null, fulltext(t));
INSERT t1 VALUES ('Mit freundlichem Gr��'), ('aus Osnabr�ck');
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index c013a01b51b..ee0a30e27d0 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -581,3 +581,77 @@ t1 CREATE TABLE `t1` (
`POINT(1,3)` longblob NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo`
+geometry NOT NULL default '') ENGINE=MyISAM ;
+insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363
+36.305435,-114.992394 36.305202,-114.991219 36.305975,-114.991163
+36.306845,-114.989432 36.309452,-114.978275 36.312642,-114.977363
+36.311978,-114.975327 36.312344,-114.96502 36.31597,-114.963364
+36.313629,-114.961723 36.313721,-114.956398 36.316057,-114.951882
+36.320979,-114.947073 36.323475,-114.945207 36.326451,-114.945207
+36.326451,-114.944132 36.326061,-114.94003 36.326588,-114.924017
+36.334484,-114.923281 36.334146,-114.92564 36.331504,-114.94072
+36.319282,-114.945348 36.314812,-114.948091 36.314762,-114.951755
+36.316211,-114.952446 36.313883,-114.952644 36.309488,-114.944725
+36.313083,-114.93706 36.32043,-114.932478 36.323497,-114.924556
+36.327708,-114.922608 36.329715,-114.92009 36.328695,-114.912105
+36.323566,-114.901647 36.317952,-114.897436 36.313968,-114.895344
+36.309573,-114.891699 36.304398,-114.890569 36.303551,-114.886356
+36.302702,-114.885141 36.301351,-114.885709 36.297391,-114.892499
+36.290893,-114.902142 36.288974,-114.904941 36.288838,-114.905308
+36.289845,-114.906325 36.290395,-114.909916 36.289549,-114.914527
+36.287535,-114.918797 36.284423,-114.922982 36.279731,-114.924113
+36.277282,-114.924057 36.275817,-114.927733 36.27053,-114.929354
+36.269029,-114.929354 36.269029,-114.950856 36.268715,-114.950768
+36.264324,-114.960206 36.264293,-114.960301 36.268943,-115.006662
+36.268929,-115.008583 36.265619,-115.00665 36.264247,-115.006659
+36.246873,-115.006659 36.246873,-115.006838 36.247697,-115.010764
+36.247774,-115.015609 36.25113,-115.015765 36.254505,-115.029517
+36.254619,-115.038573 36.249317,-115.038573 36.249317,-115.023403
+36.25841,-115.023873 36.258994,-115.031845 36.259829,-115.03183
+36.261053,-115.025561 36.261095,-115.036417 36.274632,-115.033729
+36.276041,-115.032217 36.274851,-115.029845 36.273959,-115.029934
+36.274966,-115.025763 36.274896,-115.025406 36.281044,-115.028731
+36.284471,-115.036497 36.290377,-115.042071 36.291039,-115.026759
+36.298478,-115.008995 36.301966,-115.006363 36.305435),(-115.079835
+36.244369,-115.079735 36.260186,-115.076435 36.262369,-115.069758
+36.265,-115.070235 36.268757,-115.064542 36.268655,-115.061843
+36.269857,-115.062676 36.270693,-115.06305 36.272344,-115.059051
+36.281023,-115.05918 36.283008,-115.060591 36.285246,-115.061913
+36.290022,-115.062499 36.306353,-115.062499 36.306353,-115.060918
+36.30642,-115.06112 36.289779,-115.05713 36.2825,-115.057314
+36.279446,-115.060779 36.274659,-115.061366 36.27209,-115.057858
+36.26557,-115.055805 36.262883,-115.054688 36.262874,-115.047335
+36.25037,-115.044234 36.24637,-115.052434 36.24047,-115.061734
+36.23507,-115.061934 36.22677,-115.061934 36.22677,-115.061491
+36.225267,-115.062024 36.218194,-115.060134 36.218278,-115.060133
+36.210771,-115.057833 36.210771,-115.057433 36.196271,-115.062233
+36.196271,-115.062233 36.190371,-115.062233 36.190371,-115.065533
+36.190371,-115.071333 36.188571,-115.098331 36.188275,-115.098331
+36.188275,-115.098435 36.237569,-115.097535 36.240369,-115.097535
+36.240369,-115.093235 36.240369,-115.089135 36.240469,-115.083135
+36.240569,-115.083135 36.240569,-115.079835
+36.244369)))')),('85998',GeomFromText('MULTIPOLYGON(((-115.333107
+36.264587,-115.333168 36.280638,-115.333168 36.280638,-115.32226
+36.280643,-115.322538 36.274311,-115.327222 36.274258,-115.32733
+36.263026,-115.330675 36.262984,-115.332132 36.264673,-115.333107
+36.264587),(-115.247239 36.247066,-115.247438 36.218267,-115.247438
+36.218267,-115.278525 36.219263,-115.278525 36.219263,-115.301545
+36.219559,-115.332748 36.219197,-115.332757 36.220041,-115.332757
+36.220041,-115.332895 36.233514,-115.349023 36.233479,-115.351489
+36.234475,-115.353681 36.237021,-115.357106 36.239789,-115.36519
+36.243331,-115.368156 36.243487,-115.367389 36.244902,-115.364553
+36.246014,-115.359219 36.24616,-115.356186 36.248025,-115.353347
+36.248004,-115.350813 36.249507,-115.339673 36.25387,-115.333069
+36.255018,-115.333069 36.255018,-115.333042 36.247767,-115.279039
+36.248666,-115.263639 36.247466,-115.263839 36.252766,-115.261439
+36.252666,-115.261439 36.247366,-115.247239 36.247066)))'));
+select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
+t1 where object_id=85998;
+object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
+85998 MULTIPOLYGON 0 POINT(115.31877315203 -36.237472821022)
+select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
+t1 where object_id=85984;
+object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
+85984 MULTIPOLYGON 0 POINT(-114.87787186923 36.33101763469)
+drop table t1;
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 4e30d5bc110..d75dbd5d00c 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -1,14 +1,12 @@
+select -1 as "before_use_test" ;
+before_use_test
+-1
select otto from (select 1 as otto) as t1;
otto
1
select otto from (select 1 as otto) as t1;
otto
1
-select otto from (select 1 as otto) as t1;
-otto
-1
-select friedrich from (select 1 as otto) as t1;
-ERROR 42S22: Unknown column 'friedrich' in 'field list'
select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list'
select otto from (select 1 as otto) as t1;
@@ -21,3 +19,126 @@ select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list'
select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list'
+select otto from (select 1 as otto) as t1;
+otto
+1
+select 0 as "after_successful_stmt_errno" ;
+after_successful_stmt_errno
+0
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+select 1064 as "after_wrong_syntax_errno" ;
+after_wrong_syntax_errno
+1064
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+select 1064 as "after_let_var_equal_value" ;
+after_let_var_equal_value
+1064
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+set @my_var= 'abc' ;
+select 0 as "after_set_var_equal_value" ;
+after_set_var_equal_value
+0
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+select 1064 as "after_disable_warnings_command" ;
+after_disable_warnings_command
+1064
+drop table if exists t1 ;
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+drop table if exists t1 ;
+select 0 as "after_disable_warnings" ;
+after_disable_warnings
+0
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+select 3 from t1 ;
+ERROR 42S02: Table 'test.t1' doesn't exist
+select 1146 as "after_minus_masked" ;
+after_minus_masked
+1146
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+select 3 from t1 ;
+ERROR 42S02: Table 'test.t1' doesn't exist
+select 1146 as "after_!_masked" ;
+after_!_masked
+1146
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+select -1 as "after_let_errno_equal_value" ;
+after_let_errno_equal_value
+-1
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+prepare stmt from "select 3 from t1" ;
+ERROR 42S02: Table 'test.t1' doesn't exist
+select 1146 as "after_failing_prepare" ;
+after_failing_prepare
+1146
+create table t1 ( f1 char(10));
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+prepare stmt from "select 3 from t1" ;
+select 0 as "after_successful_prepare" ;
+after_successful_prepare
+0
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+execute stmt;
+3
+select 0 as "after_successful_execute" ;
+after_successful_execute
+0
+drop table t1;
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+execute stmt;
+ERROR 42S02: Table 'test.t1' doesn't exist
+select 1146 as "after_failing_execute" ;
+after_failing_execute
+1146
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+execute __stmt_;
+ERROR HY000: Unknown prepared statement handler (__stmt_) given to EXECUTE
+select 1243 as "after_failing_execute" ;
+after_failing_execute
+1243
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+deallocate prepare stmt;
+select 0 as "after_successful_deallocate" ;
+after_successful_deallocate
+0
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+deallocate prepare __stmt_;
+ERROR HY000: Unknown prepared statement handler (__stmt_) given to DEALLOCATE PREPARE
+select 1243 as "after_failing_deallocate" ;
+after_failing_deallocate
+1243
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+select 1064 as "after_--disable_abort_on_error" ;
+after_--disable_abort_on_error
+1064
+select 3 from t1 ;
+ERROR 42S02: Table 'test.t1' doesn't exist
+select 3 from t1 ;
+ERROR 42S02: Table 'test.t1' doesn't exist
+select 3 from t1 ;
+ERROR 42S02: Table 'test.t1' doesn't exist
+select 1146 as "after_!errno_masked_error" ;
+after_!errno_masked_error
+1146
+garbage ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+select 1064 as "after_--enable_abort_on_error" ;
+after_--enable_abort_on_error
+1064
+select 3 from t1 ;
+ERROR 42S02: Table 'test.t1' doesn't exist
diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result
index abe1b98b536..604084a72c2 100644
--- a/mysql-test/r/ndb_basic.result
+++ b/mysql-test/r/ndb_basic.result
@@ -414,3 +414,150 @@ select * from t1 where b IS NOT NULL;
a b
1
drop table t1;
+create table t1 (
+c1 int,
+c2 int,
+c3 int,
+c4 int,
+c5 int,
+c6 int,
+c7 int,
+c8 int,
+c9 int,
+c10 int,
+c11 int,
+c12 int,
+c13 int,
+c14 int,
+c15 int,
+c16 int,
+c17 int,
+c18 int,
+c19 int,
+c20 int,
+c21 int,
+c22 int,
+c23 int,
+c24 int,
+c25 int,
+c26 int,
+c27 int,
+c28 int,
+c29 int,
+c30 int,
+c31 int,
+c32 int,
+c33 int,
+c34 int,
+c35 int,
+c36 int,
+c37 int,
+c38 int,
+c39 int,
+c40 int,
+c41 int,
+c42 int,
+c43 int,
+c44 int,
+c45 int,
+c46 int,
+c47 int,
+c48 int,
+c49 int,
+c50 int,
+c51 int,
+c52 int,
+c53 int,
+c54 int,
+c55 int,
+c56 int,
+c57 int,
+c58 int,
+c59 int,
+c60 int,
+c61 int,
+c62 int,
+c63 int,
+c64 int,
+c65 int,
+c66 int,
+c67 int,
+c68 int,
+c69 int,
+c70 int,
+c71 int,
+c72 int,
+c73 int,
+c74 int,
+c75 int,
+c76 int,
+c77 int,
+c78 int,
+c79 int,
+c80 int,
+c81 int,
+c82 int,
+c83 int,
+c84 int,
+c85 int,
+c86 int,
+c87 int,
+c88 int,
+c89 int,
+c90 int,
+c91 int,
+c92 int,
+c93 int,
+c94 int,
+c95 int,
+c96 int,
+c97 int,
+c98 int,
+c99 int,
+c100 int,
+c101 int,
+c102 int,
+c103 int,
+c104 int,
+c105 int,
+c106 int,
+c107 int,
+c108 int,
+c109 int,
+c110 int,
+c111 int,
+c112 int,
+c113 int,
+c114 int,
+c115 int,
+c116 int,
+c117 int,
+c118 int,
+c119 int,
+c120 int,
+c121 int,
+c122 int,
+c123 int,
+c124 int,
+c125 int,
+c126 int,
+c127 int,
+c128 int,
+primary key(c1)) engine=ndb;
+drop table t1;
+create table t1 (
+a1234567890123456789012345678901234567890 int primary key,
+a12345678901234567890123456789a1234567890 int,
+index(a12345678901234567890123456789a1234567890)
+) engine=ndb;
+show tables;
+Tables_in_test
+t1
+insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1);
+explain select * from t1 where a12345678901234567890123456789a1234567890=2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a12345678901234567890123456789a1234567890 a12345678901234567890123456789a1234567890 5 const 10 Using where
+select * from t1 where a12345678901234567890123456789a1234567890=2;
+a1234567890123456789012345678901234567890 a12345678901234567890123456789a1234567890
+5 2
+drop table t1;
diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result
index 25da313c67e..44109dabbc8 100644
--- a/mysql-test/r/ndb_blob.result
+++ b/mysql-test/r/ndb_blob.result
@@ -1,25 +1,5 @@
drop table if exists t1;
-drop database if exists mysqltest;
-create table t1 (
-a int not null primary key,
-b tinytext
-) engine=ndbcluster;
-insert into t1 values(1, 'x');
-update t1 set b = 'y';
-select * from t1;
-a b
-1 y
-delete from t1;
-drop table t1;
-create table t1 (
-a int not null primary key,
-b text not null
-) engine=ndbcluster;
-insert into t1 values(1, '');
-select * from t1;
-a b
-1
-drop table t1;
+drop database if exists test2;
set autocommit=0;
create table t1 (
a int not null primary key,
@@ -102,6 +82,53 @@ commit;
select count(*) from t1;
count(*)
0
+replace t1 set a=1,b=@b1,c=111,d=@d1;
+replace t1 set a=2,b=@b2,c=222,d=@d2;
+commit;
+explain select * from t1 where a = 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
+select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
+from t1 where a=1;
+a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
+1 2256 b1 3000 dd1
+select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
+from t1 where a=2;
+a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3)
+2 20000 b2 30000 dd2
+replace t1 set a=1,b=@b2,c=111,d=@d2;
+replace t1 set a=2,b=@b1,c=222,d=@d1;
+commit;
+select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
+from t1 where a=1;
+a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3)
+1 20000 b2 30000 dd2
+select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
+from t1 where a=2;
+a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
+2 2256 b1 3000 dd1
+replace t1 set a=1,b=concat(@b2,@b2),c=111,d=concat(@d2,@d2);
+replace t1 set a=2,b=concat(@b1,@b1),c=222,d=concat(@d1,@d1);
+commit;
+select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
+from t1 where a=1;
+a length(b) substr(b,1+4*9000,2) length(d) substr(d,1+6*9000,3)
+1 40000 b2 60000 dd2
+select a,length(b),substr(b,1+4*900,2),length(d),substr(d,1+6*900,3)
+from t1 where a=2;
+a length(b) substr(b,1+4*900,2) length(d) substr(d,1+6*900,3)
+2 4512 b1 6000 dd1
+replace t1 set a=1,b='xyz',c=111,d=null;
+commit;
+select a,b from t1 where d is null;
+a b
+1 xyz
+delete from t1 where a=1;
+delete from t1 where a=2;
+commit;
+select count(*) from t1;
+count(*)
+0
insert into t1 values(1,@b1,111,@d1);
insert into t1 values(2,@b2,222,@d2);
commit;
@@ -241,90 +268,6 @@ a b c d
7 7xb7 777 7xdd7
8 8xb8 888 8xdd8
9 9xb9 999 9xdd9
-select * from t1 order by a;
-a b c d
-1 1xb1 111 1xdd1
-2 2xb2 222 2xdd2
-3 3xb3 333 3xdd3
-4 4xb4 444 4xdd4
-5 5xb5 555 5xdd5
-6 6xb6 666 6xdd6
-7 7xb7 777 7xdd7
-8 8xb8 888 8xdd8
-9 9xb9 999 9xdd9
-alter table t1 add x int;
-select * from t1 order by a;
-a b c d x
-1 1xb1 111 1xdd1 NULL
-2 2xb2 222 2xdd2 NULL
-3 3xb3 333 3xdd3 NULL
-4 4xb4 444 4xdd4 NULL
-5 5xb5 555 5xdd5 NULL
-6 6xb6 666 6xdd6 NULL
-7 7xb7 777 7xdd7 NULL
-8 8xb8 888 8xdd8 NULL
-9 9xb9 999 9xdd9 NULL
-alter table t1 drop x;
-select * from t1 order by a;
-a b c d
-1 1xb1 111 1xdd1
-2 2xb2 222 2xdd2
-3 3xb3 333 3xdd3
-4 4xb4 444 4xdd4
-5 5xb5 555 5xdd5
-6 6xb6 666 6xdd6
-7 7xb7 777 7xdd7
-8 8xb8 888 8xdd8
-9 9xb9 999 9xdd9
-create database mysqltest;
-use mysqltest;
-CREATE TABLE t2 (
-a bigint unsigned NOT NULL PRIMARY KEY,
-b int unsigned not null,
-c int unsigned
-) engine=ndbcluster;
-insert into t2 values (1,1,1),(2,2,2);
-select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a;
-a b c d a b c
-1 1xb1 111 1xdd1 1 1 1
-2 2xb2 222 2xdd2 2 2 2
-drop table t2;
-use test;
-select * from t1 order by a;
-a b c d
-1 1xb1 111 1xdd1
-2 2xb2 222 2xdd2
-3 3xb3 333 3xdd3
-4 4xb4 444 4xdd4
-5 5xb5 555 5xdd5
-6 6xb6 666 6xdd6
-7 7xb7 777 7xdd7
-8 8xb8 888 8xdd8
-9 9xb9 999 9xdd9
-alter table t1 add x int;
-select * from t1 order by a;
-a b c d x
-1 1xb1 111 1xdd1 NULL
-2 2xb2 222 2xdd2 NULL
-3 3xb3 333 3xdd3 NULL
-4 4xb4 444 4xdd4 NULL
-5 5xb5 555 5xdd5 NULL
-6 6xb6 666 6xdd6 NULL
-7 7xb7 777 7xdd7 NULL
-8 8xb8 888 8xdd8 NULL
-9 9xb9 999 9xdd9 NULL
-alter table t1 drop x;
-select * from t1 order by a;
-a b c d
-1 1xb1 111 1xdd1
-2 2xb2 222 2xdd2
-3 3xb3 333 3xdd3
-4 4xb4 444 4xdd4
-5 5xb5 555 5xdd5
-6 6xb6 666 6xdd6
-7 7xb7 777 7xdd7
-8 8xb8 888 8xdd8
-9 9xb9 999 9xdd9
delete from t1 where c >= 100;
commit;
select count(*) from t1;
@@ -375,8 +318,128 @@ rollback;
select count(*) from t1;
count(*)
0
+insert into t1 values(1,'b1',111,'dd1');
+insert into t1 values(2,'b2',222,'dd2');
+insert into t1 values(3,'b3',333,'dd3');
+insert into t1 values(4,'b4',444,'dd4');
+insert into t1 values(5,'b5',555,'dd5');
+insert into t1 values(6,'b6',666,'dd6');
+insert into t1 values(7,'b7',777,'dd7');
+insert into t1 values(8,'b8',888,'dd8');
+insert into t1 values(9,'b9',999,'dd9');
+commit;
+select * from t1 order by a;
+a b c d
+1 b1 111 dd1
+2 b2 222 dd2
+3 b3 333 dd3
+4 b4 444 dd4
+5 b5 555 dd5
+6 b6 666 dd6
+7 b7 777 dd7
+8 b8 888 dd8
+9 b9 999 dd9
+alter table t1 add x int;
+select * from t1 order by a;
+a b c d x
+1 b1 111 dd1 NULL
+2 b2 222 dd2 NULL
+3 b3 333 dd3 NULL
+4 b4 444 dd4 NULL
+5 b5 555 dd5 NULL
+6 b6 666 dd6 NULL
+7 b7 777 dd7 NULL
+8 b8 888 dd8 NULL
+9 b9 999 dd9 NULL
+alter table t1 drop x;
+select * from t1 order by a;
+a b c d
+1 b1 111 dd1
+2 b2 222 dd2
+3 b3 333 dd3
+4 b4 444 dd4
+5 b5 555 dd5
+6 b6 666 dd6
+7 b7 777 dd7
+8 b8 888 dd8
+9 b9 999 dd9
+create database test2;
+use test2;
+CREATE TABLE t2 (
+a bigint unsigned NOT NULL PRIMARY KEY,
+b int unsigned not null,
+c int unsigned
+) engine=ndbcluster;
+insert into t2 values (1,1,1),(2,2,2);
+select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a;
+a b c d a b c
+1 b1 111 dd1 1 1 1
+2 b2 222 dd2 2 2 2
+drop table t2;
+use test;
+select * from t1 order by a;
+a b c d
+1 b1 111 dd1
+2 b2 222 dd2
+3 b3 333 dd3
+4 b4 444 dd4
+5 b5 555 dd5
+6 b6 666 dd6
+7 b7 777 dd7
+8 b8 888 dd8
+9 b9 999 dd9
+alter table t1 add x int;
+select * from t1 order by a;
+a b c d x
+1 b1 111 dd1 NULL
+2 b2 222 dd2 NULL
+3 b3 333 dd3 NULL
+4 b4 444 dd4 NULL
+5 b5 555 dd5 NULL
+6 b6 666 dd6 NULL
+7 b7 777 dd7 NULL
+8 b8 888 dd8 NULL
+9 b9 999 dd9 NULL
+alter table t1 drop x;
+select * from t1 order by a;
+a b c d
+1 b1 111 dd1
+2 b2 222 dd2
+3 b3 333 dd3
+4 b4 444 dd4
+5 b5 555 dd5
+6 b6 666 dd6
+7 b7 777 dd7
+8 b8 888 dd8
+9 b9 999 dd9
+drop table t1;
+drop database test2;
+set autocommit=0;
+create table t1 (
+a int not null primary key,
+b tinytext
+) engine=ndbcluster;
+insert into t1 values(1, 'x');
+update t1 set b = 'y';
+select * from t1;
+a b
+1 y
+delete from t1;
+select * from t1;
+a b
+commit;
+drop table t1;
+set autocommit=0;
+create table t1 (
+a int not null primary key,
+b text not null
+) engine=ndbcluster;
+insert into t1 values(1, '');
+select * from t1;
+a b
+1
+commit;
drop table t1;
-drop database mysqltest;
set autocommit=1;
use test;
CREATE TABLE t1 (
@@ -397,6 +460,7 @@ select * from t1 order by a;
a b
1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
+set autocommit=1;
alter table t1 engine=myisam;
select * from t1 order by a;
a b
diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result
index cdc445558b9..16c76f39680 100644
--- a/mysql-test/r/ndb_insert.result
+++ b/mysql-test/r/ndb_insert.result
@@ -557,3 +557,32 @@ select * from t1 where pk1=1;
pk1 b c
1 2 3
DROP TABLE t1;
+CREATE TABLE t1(a INT) ENGINE=ndb;
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 SELECT a FROM t1;
+INSERT IGNORE INTO t1 SELECT a FROM t1;
+INSERT IGNORE INTO t1 SELECT a FROM t1;
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (1);
+SELECT * FROM t1;
+a
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+DROP TABLE t1;
diff --git a/mysql-test/r/ps_10nestset.result b/mysql-test/r/ps_10nestset.result
index 68f58a03674..ff63485a5f9 100644
--- a/mysql-test/r/ps_10nestset.result
+++ b/mysql-test/r/ps_10nestset.result
@@ -62,4 +62,15 @@ id emp salary l r
4 Donna 1064.80 5 6
5 Eddie 931.70 7 8
6 Fred 798.60 9 10
+prepare st_round from 'update t1 set salary = salary + ? - ( salary MOD ? )';
+set @arg_round= 50;
+execute st_round using @arg_round, @arg_round;
+select * from t1;
+id emp salary l r
+1 Jerry 1350.00 1 12
+2 Bert 1200.00 2 3
+3 Chuck 1250.00 4 11
+4 Donna 1100.00 5 6
+5 Eddie 950.00 7 8
+6 Fred 800.00 9 10
drop table t1;
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index 1a096a58252..e4333cc91fc 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -1580,7 +1580,9 @@ a b
1200 x1000_1updatedupdated
delete from t1 where a >= 1000 ;
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
+execute stmt1;
+execute stmt1;
+execute stmt1;
test_sequence
------ multi table tests ------
delete from t1 ;
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index 5c22beeb56b..30a5fd25ebd 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -1563,7 +1563,9 @@ a b
1200 x1000_1updatedupdated
delete from t1 where a >= 1000 ;
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
+execute stmt1;
+execute stmt1;
+execute stmt1;
test_sequence
------ multi table tests ------
delete from t1 ;
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index 9cbe87b004a..779f1e79cef 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -1564,7 +1564,9 @@ a b
1200 x1000_1updatedupdated
delete from t1 where a >= 1000 ;
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
+execute stmt1;
+execute stmt1;
+execute stmt1;
test_sequence
------ multi table tests ------
delete from t1 ;
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index 4ed0295a92e..5e31bd9d4e1 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -1606,7 +1606,9 @@ a b
1200 x1000_1updatedupdated
delete from t1 where a >= 1000 ;
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
+execute stmt1;
+execute stmt1;
+execute stmt1;
test_sequence
------ multi table tests ------
delete from t1 ;
@@ -4613,7 +4615,9 @@ a b
1200 x1000_1updatedupdated
delete from t1 where a >= 1000 ;
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
+execute stmt1;
+execute stmt1;
+execute stmt1;
test_sequence
------ multi table tests ------
delete from t1 ;
diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result
index 7ec7e303b42..202c6980430 100644
--- a/mysql-test/r/ps_6bdb.result
+++ b/mysql-test/r/ps_6bdb.result
@@ -1563,7 +1563,9 @@ a b
1200 x1000_1updatedupdated
delete from t1 where a >= 1000 ;
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
+execute stmt1;
+execute stmt1;
+execute stmt1;
test_sequence
------ multi table tests ------
delete from t1 ;
diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result
index cf567750b85..85e51df776f 100644
--- a/mysql-test/r/ps_7ndb.result
+++ b/mysql-test/r/ps_7ndb.result
@@ -1543,7 +1543,6 @@ a b
1000 x1000_1
delete from t1 where a >= 1000 ;
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
test_sequence
------ multi table tests ------
delete from t1 ;
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index e7375b428c2..1374a8fd0ed 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -547,3 +547,20 @@ select count(*) from t2 where x = 18446744073709551601;
count(*)
0
drop table t1,t2;
+set names latin1;
+create table t1 (a char(10), b text, key (a)) character set latin1;
+INSERT INTO t1 (a) VALUES
+('111'),('222'),('222'),('222'),('222'),('444'),('aaa'),('AAA'),('bbb');
+explain select * from t1 where a='aaa';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 11 const 2 Using where
+explain select * from t1 where a=binary 'aaa';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 11 NULL 2 Using where
+explain select * from t1 where a='aaa' collate latin1_bin;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 11 NULL 2 Using where
+explain select * from t1 where a='aaa' collate latin1_german1_ci;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL a NULL NULL NULL 9 Using where
+drop table t1;
diff --git a/mysql-test/r/rpl_failed_optimize.result b/mysql-test/r/rpl_failed_optimize.result
new file mode 100644
index 00000000000..1576ec60500
--- /dev/null
+++ b/mysql-test/r/rpl_failed_optimize.result
@@ -0,0 +1,15 @@
+stop slave;
+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;
+start slave;
+CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 VALUES (1);
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status Operation failed
+OPTIMIZE TABLE non_existing;
+Table Op Msg_type Msg_text
+test.non_existing optimize error Table 'test.non_existing' doesn't exist
diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result
index a892967ac79..67446829eca 100644
--- a/mysql-test/r/sql_mode.result
+++ b/mysql-test/r/sql_mode.result
@@ -85,6 +85,36 @@ t1 CREATE TABLE "t1" (
UNIQUE KEY "email" ("email")
)
drop table t1;
+CREATE TABLE t1 (
+a char(10),
+b char(10) collate latin1_bin,
+c binary(10)
+) character set latin1;
+set @@sql_mode="";
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(10) default NULL,
+ `b` char(10) character set latin1 collate latin1_bin default NULL,
+ `c` binary(10) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+set @@sql_mode="mysql323";
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(10) default NULL,
+ `b` char(10) binary default NULL,
+ `c` binary(10) default NULL
+) TYPE=MyISAM
+set @@sql_mode="mysql40";
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(10) default NULL,
+ `b` char(10) binary default NULL,
+ `c` binary(10) default NULL
+) TYPE=MyISAM
+drop table t1;
set session sql_mode = '';
create table t1 ( min_num dec(6,6) default .000001);
show create table t1;