1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
#!/usr/bin/env tarantool
test = require("sqltester")
test:plan(10)
test:do_catchsql_test(
"pragma-1.3",
[[
PRAGMA kek = 'ON';
]], {
1, "Pragma 'KEK' does not exist"
})
---
--- gh-2199: SQL default engine pragma
---
test:do_catchsql_test(
"pragma-2.1",
[[
pragma sql_default_engine='creepy';
]], {
1, "Pragma 'SQL_DEFAULT_ENGINE' does not exist"
})
--
-- gh-3733: remove useless or obsolete pragmas
--
---
--- Prerequisites
---
test:execsql(
[[
DROP TABLE IF EXISTS gh3733;
CREATE TABLE gh3733(id INT primary key, f NUMBER);
INSERT INTO gh3733 VALUES(1, 0.1), (2, 0.2), (3, 0.3);
CREATE INDEX IDX ON GH3733 (id);
]])
---
--- pragma query_only is not supported
---
test:do_catchsql_test(
"pragma-4.1",
[[
pragma query_only;
]], {
-- <pragma-4.1>
1, "Pragma 'QUERY_ONLY' does not exist"
-- </pragma-4.1>
})
---
--- pragma read_uncommitted is not supported
---
test:do_catchsql_test(
"pragma-5.1",
[[
pragma read_uncommitted;
]], {
-- <pragma-5.1>
1, "Pragma 'READ_UNCOMMITTED' does not exist"
-- </pragma-5.1>
})
---
--- pragma index_list returns three columns in a row
---
test:do_execsql_test(
"pragma-6.1",
[[
pragma index_list(gh3733)
]], {
-- <pragma-6.1>
0, 'pk_unnamed_GH3733_1', 1, 1, 'IDX', 0
-- </pragma-6.1>
})
---
--- pragma index_list returns an empty tuple for unknown table
---
test:do_execsql_test(
"pragma-7.1",
[[
pragma index_list(fufel);
]], {
-- <pragma-7.1>
-- </pragma-7.1>
})
---
--- pragma index_info returns an empty tuple for unknown index
---
test:do_execsql_test(
"pragma-8.1",
[[
pragma index_info(gh3733.IDX)
]], {
-- <pragma-8.1>
0, 0, 'ID', 0, 'BINARY', 'integer'
-- </pragma-8.1>
})
test:do_execsql_test(
"pragma-8.2",
[[
pragma index_info(no_table);
]], {
-- <pragma-8.2>
-- </pragma-8.2>
})
test:do_execsql_test(
"pragma-8.3",
[[
pragma index_info(wrong_table.IDX);
]], {
-- <pragma-8.3>
-- </pragma-8.3>
})
test:do_execsql_test(
"pragma-8.4",
[[
pragma index_info(gh3733.wrong_index);
]], {
-- <pragma-8.4>
-- </pragma-8.4>
})
test:finish_test()
|