2021-09-12 12:35:27 +00:00
-- Tags: no-ordinary-database, no-fasttest
-- Tag no-ordinary-database: Sometimes cannot lock file most likely due to concurrent or adjacent tests, but we don't care how it works in Ordinary database
-- Tag no-fasttest: In fasttest, ENABLE_LIBRARIES=0, so rocksdb engine is not enabled by default
2021-06-02 15:55:20 +00:00
DROP TABLE IF EXISTS 01686 _test ;
2021-02-02 07:56:22 +00:00
2021-06-02 15:55:20 +00:00
CREATE TABLE 01686 _test ( key UInt64 , value String ) Engine = EmbeddedRocksDB PRIMARY KEY ( key ) ;
2021-02-02 07:56:22 +00:00
2021-07-26 18:17:39 +00:00
SELECT value FROM system . rocksdb WHERE database = currentDatabase ( ) and table = ' 01686_test ' and name = ' number.keys.written ' ;
2021-06-02 15:55:20 +00:00
INSERT INTO 01686 _test SELECT number , format ( ' Hello, world ({}) ' , toString ( number ) ) FROM numbers ( 10000 ) ;
2021-07-26 18:17:39 +00:00
SELECT value FROM system . rocksdb WHERE database = currentDatabase ( ) and table = ' 01686_test ' and name = ' number.keys.written ' ;
2021-02-02 07:56:22 +00:00
2021-06-02 15:55:20 +00:00
SELECT * FROM 01686 _test WHERE key = 123 ;
2021-02-02 07:56:22 +00:00
SELECT ' -- ' ;
2021-06-02 15:55:20 +00:00
SELECT * FROM 01686 _test WHERE key = - 123 ;
2021-02-02 07:56:22 +00:00
SELECT ' -- ' ;
2021-06-02 15:55:20 +00:00
SELECT * FROM 01686 _test WHERE key = 123 OR key = 4567 ORDER BY key ;
2021-02-02 07:56:22 +00:00
SELECT ' -- ' ;
2021-06-02 15:55:20 +00:00
SELECT * FROM 01686 _test WHERE key = NULL ;
2021-02-02 07:56:22 +00:00
SELECT ' -- ' ;
2021-06-02 15:55:20 +00:00
SELECT * FROM 01686 _test WHERE key = NULL OR key = 0 ;
2021-02-02 07:56:22 +00:00
SELECT ' -- ' ;
2021-06-02 15:55:20 +00:00
SELECT * FROM 01686 _test WHERE key IN ( 123 , 456 , - 123 ) ORDER BY key ;
2021-02-02 07:56:22 +00:00
SELECT ' -- ' ;
2021-06-02 15:55:20 +00:00
SELECT * FROM 01686 _test WHERE key = ' Hello ' ; -- { serverError 53 }
2021-02-02 07:56:22 +00:00
2021-06-02 15:55:20 +00:00
DETACH TABLE 01686 _test NO DELAY ;
ATTACH TABLE 01686 _test ;
2021-02-02 07:56:22 +00:00
2021-06-02 15:55:20 +00:00
SELECT * FROM 01686 _test WHERE key IN ( 99 , 999 , 9999 , - 123 ) ORDER BY key ;
2021-02-02 07:56:22 +00:00
2021-06-02 15:55:20 +00:00
DROP TABLE IF EXISTS 01686 _test ;