| 1 |
# |
| 2 |
# Basic CREATE TABLE statements |
| 3 |
# |
| 4 |
|
| 5 |
--source have_engine.inc |
| 6 |
|
| 7 |
--disable_warnings |
| 8 |
DROP TABLE IF EXISTS t1,t2; |
| 9 |
--enable_warnings |
| 10 |
|
| 11 |
# Simple create table with minimal table options |
| 12 |
# which are defined in have_engine.inc |
| 13 |
# (default empty) plus ENGINE= |
| 14 |
|
| 15 |
--let $create_definition = a $int_col |
| 16 |
--source create_table.inc |
| 17 |
if ($mysql_errname) |
| 18 |
{ |
| 19 |
--let $functionality = CREATE TABLE |
| 20 |
--source unexpected_result.inc |
| 21 |
} |
| 22 |
if (!$mysql_errname) |
| 23 |
{ |
| 24 |
--source mask_engine.inc |
| 25 |
SHOW CREATE TABLE t1; |
| 26 |
|
| 27 |
# IF NOT EXISTS |
| 28 |
--let $if_not_exists = 1 |
| 29 |
--let $create_definition = a $int_col |
| 30 |
--source create_table.inc |
| 31 |
} |
| 32 |
|
| 33 |
# CREATE .. LIKE |
| 34 |
|
| 35 |
CREATE TABLE t2 LIKE t1; |
| 36 |
if ($mysql_errname) |
| 37 |
{ |
| 38 |
--let $functionality = CREATE TABLE .. LIKE |
| 39 |
--source unexpected_result.inc |
| 40 |
} |
| 41 |
if (!$mysql_errname) |
| 42 |
{ |
| 43 |
--source mask_engine.inc |
| 44 |
SHOW CREATE TABLE t2; |
| 45 |
|
| 46 |
eval |
| 47 |
CREATE TEMPORARY TABLE t2 LIKE t1; |
| 48 |
if ($mysql_errname) |
| 49 |
{ |
| 50 |
--let $functionality = Temporary tables |
| 51 |
--source unexpected_result.inc |
| 52 |
} |
| 53 |
if (!$mysql_errname) |
| 54 |
{ |
| 55 |
--source mask_engine.inc |
| 56 |
SHOW CREATE TABLE t2; |
| 57 |
|
| 58 |
DROP TEMPORARY TABLE t2; |
| 59 |
} |
| 60 |
DROP TABLE t2; |
| 61 |
} |
| 62 |
DROP TABLE IF EXISTS t1; |
| 63 |
|
| 64 |
# CREATE .. AS SELECT |
| 65 |
|
| 66 |
--let $as_select = SELECT 1 UNION SELECT 2 |
| 67 |
--source create_table.inc |
| 68 |
if ($mysql_errname) |
| 69 |
{ |
| 70 |
--let $functionality = CREATE TABLE .. AS SELECT |
| 71 |
--source unexpected_result.inc |
| 72 |
} |
| 73 |
if (!$mysql_errname) |
| 74 |
{ |
| 75 |
--source mask_engine.inc |
| 76 |
SHOW CREATE TABLE t1; |
| 77 |
--sorted_result |
| 78 |
SELECT * FROM t1; |
| 79 |
DROP TABLE t1; |
| 80 |
} |
| 81 |
|
| 82 |
# Use the engine as default |
| 83 |
|
| 84 |
--source mask_engine.inc |
| 85 |
eval SET default_storage_engine = $storage_engine; |
| 86 |
|
| 87 |
--let $tbl_opts = $default_tbl_opts |
| 88 |
--let $create_definition = a $int_col |
| 89 |
--source create_table.inc |
| 90 |
if ($mysql_errname) |
| 91 |
{ |
| 92 |
--let $functionality = CREATE TABLE or using the engine as default |
| 93 |
--source unexpected_result.inc |
| 94 |
} |
| 95 |
if (!$mysql_errname) |
| 96 |
{ |
| 97 |
--source mask_engine.inc |
| 98 |
SHOW CREATE TABLE t1; |
| 99 |
} |
| 100 |
|
| 101 |
# Just to add FLUSH LOGS into the mix while we are in the most common test |
| 102 |
FLUSH LOGS; |
| 103 |
|
| 104 |
DROP TABLE IF EXISTS t1; |
| 105 |
|
| 106 |
--source cleanup_engine.inc |
| 107 |
|