mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-30 19:46:48 +00:00
tests/cql_query_test: TINYINT and SMALLINT type test cases
This commit is contained in:
@@ -1358,11 +1358,13 @@ SEASTAR_TEST_CASE(test_types) {
|
||||
" m varchar,"
|
||||
" n varint,"
|
||||
" o decimal,"
|
||||
" p tinyint,"
|
||||
" q smallint,"
|
||||
");").discard_result();
|
||||
}).then([&e] {
|
||||
e.require_table_exists("ks", "all_types");
|
||||
return e.execute_cql(
|
||||
"INSERT INTO all_types (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) VALUES ("
|
||||
"INSERT INTO all_types (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) VALUES ("
|
||||
" 'ascii',"
|
||||
" 123456789,"
|
||||
" 0xdeadbeef,"
|
||||
@@ -1377,7 +1379,9 @@ SEASTAR_TEST_CASE(test_types) {
|
||||
" d2177dd0-eaa2-11de-a572-001b779c76e3,"
|
||||
" 'varchar',"
|
||||
" 123,"
|
||||
" 1.23"
|
||||
" 1.23,"
|
||||
" 3,"
|
||||
" 3"
|
||||
");").discard_result();
|
||||
}).then([&e] {
|
||||
return e.execute_cql("SELECT * FROM all_types WHERE a = 'ascii'");
|
||||
@@ -1401,11 +1405,13 @@ SEASTAR_TEST_CASE(test_types) {
|
||||
timeuuid_type->decompose(utils::UUID(sstring("d2177dd0-eaa2-11de-a572-001b779c76e3"))),
|
||||
uuid_type->decompose(utils::UUID(sstring("d2177dd0-eaa2-11de-a572-001b779c76e3"))),
|
||||
utf8_type->decompose(sstring("varchar")), varint_type->decompose(boost::multiprecision::cpp_int(123)),
|
||||
decimal_type->decompose(big_decimal { 2, boost::multiprecision::cpp_int(123) })
|
||||
decimal_type->decompose(big_decimal { 2, boost::multiprecision::cpp_int(123) }),
|
||||
byte_type->decompose(int8_t(3)),
|
||||
short_type->decompose(int16_t(3)),
|
||||
}
|
||||
});
|
||||
return e.execute_cql(
|
||||
"INSERT INTO all_types (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) VALUES ("
|
||||
"INSERT INTO all_types (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) VALUES ("
|
||||
" blobAsAscii(asciiAsBlob('ascii2')),"
|
||||
" blobAsBigint(bigintAsBlob(123456789)),"
|
||||
" bigintAsBlob(12),"
|
||||
@@ -1419,7 +1425,9 @@ SEASTAR_TEST_CASE(test_types) {
|
||||
" blobAsTimeuuid(timeuuidAsBlob(d2177dd0-eaa2-11de-a572-001b779c76e3)),"
|
||||
" blobAsUuid(uuidAsBlob(d2177dd0-eaa2-11de-a572-001b779c76e3)),"
|
||||
" blobAsVarchar(varcharAsBlob('varchar')), blobAsVarint(varintAsBlob(123)),"
|
||||
" blobAsDecimal(decimalAsBlob(1.23))"
|
||||
" blobAsDecimal(decimalAsBlob(1.23)),"
|
||||
" blobAsTinyint(tinyintAsBlob(3)),"
|
||||
" blobAsSmallint(smallintAsBlob(3))"
|
||||
");").discard_result();
|
||||
}).then([&e] {
|
||||
return e.execute_cql("SELECT * FROM all_types WHERE a = 'ascii2'");
|
||||
@@ -1443,7 +1451,9 @@ SEASTAR_TEST_CASE(test_types) {
|
||||
timeuuid_type->decompose(utils::UUID(sstring("d2177dd0-eaa2-11de-a572-001b779c76e3"))),
|
||||
uuid_type->decompose(utils::UUID(sstring("d2177dd0-eaa2-11de-a572-001b779c76e3"))),
|
||||
utf8_type->decompose(sstring("varchar")), varint_type->decompose(boost::multiprecision::cpp_int(123)),
|
||||
decimal_type->decompose(big_decimal { 2, boost::multiprecision::cpp_int(123) })
|
||||
decimal_type->decompose(big_decimal { 2, boost::multiprecision::cpp_int(123) }),
|
||||
byte_type->decompose(int8_t(3)),
|
||||
short_type->decompose(int16_t(3)),
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user