3469 Pekka Nousiainen 2012-04-06
wl#946 a05_sel.diff
verify ndb_select_all fields unpack and display
added:
mysql-test/suite/ndb/t/ndb_wl946_select_all.inc
modified:
mysql-test/suite/ndb/r/ndb_wl946_main.result
mysql-test/suite/ndb/t/ndb_wl946_main.test
3468 Pekka Nousiainen 2012-04-05
wl#946 x02_fix.diff
missing sum() in query check
modified:
mysql-test/suite/ndb/r/ndb_wl946_main.result
mysql-test/suite/ndb/t/ndb_wl946_main_query.inc
=== modified file 'mysql-test/suite/ndb/r/ndb_wl946_main.result'
--- a/mysql-test/suite/ndb/r/ndb_wl946_main.result 2012-04-05 12:48:47 +0000
+++ b/mysql-test/suite/ndb/r/ndb_wl946_main.result 2012-04-06 07:53:42 +0000
@@ -70,6 +70,24 @@ load data local infile 'suite/ndb/data/w
select count(*), sum(crc32(concat(a,b,c,d,e,f))) from t1;
count(*) sum(crc32(concat(a,b,c,d,e,f)))
500 1099869477618
+# verify ndb_select_all
+create temporary table t1tmp (
+a int primary key,
+b char(40),
+c char(40),
+d char(40),
+e char(40),
+f char(40)
+) engine=myisam;
+load data infile 'DUMP_FILE' into table t1tmp
+fields terminated by ',';
+select count(*), sum(crc32(concat(a,b,c,d,e,unix_timestamp(f)))) from t1;
+count(*) sum(crc32(concat(a,b,c,d,e,unix_timestamp(f))))
+500 1042802316591
+select count(*), sum(crc32(concat(a,b,c,d,replace(e,'/',' '),f))) from t1tmp;
+count(*) sum(crc32(concat(a,b,c,d,replace(e,'/',' '),f)))
+500 1042802316591
+drop table t1tmp;
# index queries
select * from t1 where b = '2011';
a b c d e f
@@ -187,6 +205,24 @@ load data local infile 'suite/ndb/data/w
select count(*), sum(crc32(concat(a,b,c,d,e,f))) from t1;
count(*) sum(crc32(concat(a,b,c,d,e,f)))
500 1091780159996
+# verify ndb_select_all
+create temporary table t1tmp (
+a int primary key,
+b char(40),
+c char(40),
+d char(40),
+e char(40),
+f char(40)
+) engine=myisam;
+load data infile 'DUMP_FILE' into table t1tmp
+fields terminated by ',';
+select count(*), sum(crc32(concat(a,b,c,d,e,unix_timestamp(f)))) from t1;
+count(*) sum(crc32(concat(a,b,c,d,e,unix_timestamp(f))))
+500 1102908582969
+select count(*), sum(crc32(concat(a,b,c,d,replace(e,'/',' '),f))) from t1tmp;
+count(*) sum(crc32(concat(a,b,c,d,replace(e,'/',' '),f)))
+500 1102908582969
+drop table t1tmp;
# index queries
select * from t1 where b = '1984';
a b c d e f
@@ -422,7 +458,7 @@ count(*) sum(crc32(concat(a,b,c,d,e,f)))
500 1091780159996
# check contents truncated to prec 3
drop table if exists t1tmp;
-create table t1tmp (
+create temporary table t1tmp (
x char(255)
) engine=myisam;
insert into t1tmp select concat(a,b,c,left(d,length(d)-3),left(e,length(e)-3),left(f,length(f)-3)) from t1;
=== modified file 'mysql-test/suite/ndb/t/ndb_wl946_main.test'
--- a/mysql-test/suite/ndb/t/ndb_wl946_main.test 2012-04-03 11:47:44 +0000
+++ b/mysql-test/suite/ndb/t/ndb_wl946_main.test 2012-04-06 07:53:42 +0000
@@ -37,6 +37,8 @@ load data local infile 'suite/ndb/data/w
--echo # check contents
select count(*), sum(crc32(concat(a,b,c,d,e,f))) from t1;
+--echo # verify ndb_select_all
+--source ndb_wl946_select_all.inc
--echo # index queries
select * from t1 where b = '2011';
@@ -79,6 +81,8 @@ load data local infile 'suite/ndb/data/w
--echo # check contents
select count(*), sum(crc32(concat(a,b,c,d,e,f))) from t1;
+--echo # verify ndb_select_all
+--source ndb_wl946_select_all.inc
--echo # index queries
select * from t1 where b = '1984';
@@ -183,7 +187,7 @@ if (!$works)
--disable_warnings
drop table if exists t1tmp;
--enable_warnings
-create table t1tmp (
+create temporary table t1tmp (
x char(255)
) engine=myisam;
insert into t1tmp select concat(a,b,c,left(d,length(d)-3),left(e,length(e)-3),left(f,length(f)-3)) from t1;
=== added file 'mysql-test/suite/ndb/t/ndb_wl946_select_all.inc'
--- a/mysql-test/suite/ndb/t/ndb_wl946_select_all.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_wl946_select_all.inc 2012-04-06 07:53:42 +0000
@@ -0,0 +1,28 @@
+# verify that ndb_select_all unpacks the fields correctly and
+# displays them like mysql, with 2 differences accounted for:
+#
+# date/time uses "/" as separator instead of blank
+# timestamp is displayed as unix timestamp
+
+--let $dump_file = $MYSQLTEST_VARDIR/tmp/wl946_select_all.txt
+--exec $NDB_SELECT_ALL --no-defaults -d test --delimiter=, t1 | grep '^[0-9]*,' > $dump_file
+
+create temporary table t1tmp (
+ a int primary key,
+ b char(40),
+ c char(40),
+ d char(40),
+ e char(40),
+ f char(40)
+) engine=myisam;
+
+--chmod 0777 $dump_file
+--replace_result $dump_file DUMP_FILE
+eval load data infile '$dump_file' into table t1tmp
+fields terminated by ',';
+--remove_file $dump_file
+
+select count(*), sum(crc32(concat(a,b,c,d,e,unix_timestamp(f)))) from t1;
+select count(*), sum(crc32(concat(a,b,c,d,replace(e,'/',' '),f))) from t1tmp;
+
+drop table t1tmp;
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk-cluster branch (pekka.nousiainen:3468 to 3469)WL#946 | Pekka Nousiainen | 10 Apr |