~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/randgen_queries.test

  • Committer: Stewart Smith
  • Date: 2010-06-16 14:17:58 UTC
  • mto: (1626.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 1633.
  • Revision ID: stewart@flamingspork.com-20100616141758-odpf36m0wo09ok4c
add handler_write status variable test for when statement was rolled back

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
key (`col_enum_key` )) ENGINE=innodb;
46
46
set AUTOCOMMIT=OFF;
47
47
 
48
 
# bookkeeping query in Executor/Drizzle.pm in randgen
49
 
select SQL_BIG_RESULT table_schema, 
 
48
#
 
49
select table_schema, 
50
50
       table_name, 
51
51
       CASE WHEN table_type = 'STANDARD' THEN 'table' 
52
52
            WHEN table_type = 'FUNCTION' then 'function' 
53
53
       ELSE 'misc' END, 
54
54
       column_name,
55
 
       CASE WHEN IS_USED_IN_PRIMARY = 'YES' THEN 'primary' 
56
 
             WHEN IS_INDEXED = 'YES' THEN 'indexed' 
 
55
       CASE WHEN IS_USED_IN_PRIMARY = 'TRUE' THEN 'primary' 
 
56
             WHEN IS_INDEXED = 'TRUE' THEN 'indexed' 
57
57
       ELSE 'indexed' END 
58
58
       FROM data_dictionary.tables INNER JOIN
59
 
            data_dictionary.columns USING(table_schema, table_name) ORDER BY table_schema, table_name limit 20;
60
 
# end bookkeeping test
61
 
 
62
 
# bookkeeping query in Executor/Drizzle.pm in randgen - variant 1
63
 
# test of non-DATA_DICTIONARY / INFORMATION_SCHEMA tables
64
 
COMMIT;
65
 
CREATE SCHEMA randgen_query_test;
66
 
USE randgen_query_test;
67
 
CREATE TABLE t1 (a INT);
68
 
CREATE TABLE t2 LIKE t1;
69
 
CREATE TABLE t3 LIKE t1;
70
 
CREATE TABLE t4 (b CHAR(500));
71
 
CREATE TABLE t5 LIKE t4;
72
 
 
73
 
select SQL_BIG_RESULT table_schema,
74
 
       table_name,
75
 
       CASE WHEN table_type = 'STANDARD' THEN 'table'
76
 
            WHEN table_type = 'FUNCTION' then 'function'
77
 
       ELSE 'misc' END,
78
 
       column_name,
79
 
       CASE WHEN IS_USED_IN_PRIMARY = 'YES' THEN 'primary'
80
 
             WHEN IS_INDEXED = 'YES' THEN 'indexed'
81
 
       ELSE 'indexed' END
82
 
       FROM data_dictionary.tables INNER JOIN
83
 
            data_dictionary.columns USING(table_schema, table_name) WHERE table_schema NOT IN ('DATA_DICTIONARY','INFORMATION_SCHEMA')
84
 
       ORDER BY table_schema, table_name limit 20;
85
 
 
86
 
COMMIT;
87
 
DROP SCHEMA randgen_query_test;
88
 
USE test;
89
 
# end bookkeeping test
 
59
            data_dictionary.columns USING(table_schema, table_name) limit 20;
90
60
 
91
61
 
92
62
select AVG(`col_int_key`) + AVG(`col_int`) AS average1,
93
63
                        (SUM(`col_int_key`) + SUM(`col_int`)) / COUNT(*) AS average2,
94
64
                        COUNT(*) AS count FROM t1;
95
65
 
96
 
--sorted_result
97
66
select collation_name,character_set_name FROM data_dictionary.collations;
98
67
--replace_column 1 ####.##.####
99
 
--sorted_result
100
68
select COUNT(*) from data_dictionary.tables;
101
 
COMMIT;
 
69
 
102
70
DROP TABLE t1;