Debian Codegraph @

mysql-test/suite/ndb/t/ndb_wl946_select_all.inc

raw
1 # verify that ndb_select_all unpacks the fields correctly and
2 # displays them like mysql, with 2 differences accounted for:
3 #
4 # date/time uses "/" as separator instead of blank
5 # timestamp is displayed as unix timestamp
6 #
7 # use mysql to grep out non-data lines
8
9 --let $dump_file1 = $MYSQLTEST_VARDIR/tmp/wl946_select_all1.txt
10 --let $dump_file2 = $MYSQLTEST_VARDIR/tmp/wl946_select_all2.txt
11
12 --exec $NDB_SELECT_ALL -d test --delimiter=, t1 > $dump_file1
13
14 create temporary table t1tmp1 (
15 x char(255)
16 ) engine=myisam;
17
18 --chmod 0777 $dump_file1
19 --replace_result $dump_file1 DUMP_FILE1
20 eval load data infile '$dump_file1' into table t1tmp1;
21
22 delete from t1tmp1 where x not regexp '^[0-9]*,';
23 --replace_result $dump_file2 DUMP_FILE2
24 eval select x from t1tmp1 into outfile '$dump_file2';
25
26 create temporary table t1tmp2 (
27 a int primary key,
28 b char(40),
29 c char(40),
30 d char(40),
31 e char(40),
32 f char(40)
33 ) engine=myisam;
34
35 --chmod 0777 $dump_file2
36 --replace_result $dump_file2 DUMP_FILE2
37 eval load data infile '$dump_file2' into table t1tmp2
38 fields terminated by ',' lines terminated by '\n';
39
40 # remove any windows CR from last field
41 update t1tmp2 set f = replace(f, '\r', '');
42
43 select count(*), sum(crc32(concat(a,b,c,d,e,unix_timestamp(f)))) from t1;
44 select count(*), sum(crc32(concat(a,b,c,d,replace(e,'/',' '),f))) from t1tmp2;
45
46 drop table t1tmp1;
47 drop table t1tmp2;
48
49 --remove_file $dump_file1
50 --remove_file $dump_file2