Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/mariadb-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ jobs:
id: mariadb-release
shell: bash
run: |
echo "tag=mariadb-12.1.2" >> $GITHUB_OUTPUT
echo "MariaDB version: mariadb-12.1.2"
echo "tag=mariadb-12.2.2" >> $GITHUB_OUTPUT
echo "MariaDB version: mariadb-12.2.2"

- name: Clone MariaDB server
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/tidesdb/include/have_tidesdb.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--require r/have_tidesdb.require
disable_query_log;
--error 0,1286
eval SET @@default_storage_engine = TidesDB;
ALTER DATABASE test DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
enable_query_log;
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/r/tidesdb_analyze.result
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test.t1 analyze Note TIDESDB: level 3 sstables=N size=N bytes keys=N
test.t1 analyze Note TIDESDB: level 4 sstables=N size=N bytes keys=N
test.t1 analyze Note TIDESDB: level 5 sstables=N size=N bytes keys=N
test.t1 analyze Note TIDESDB: idx CF 'test__t1__idx_idx_val' keys=N data_size=N bytes levels=5
test.t1 analyze Note TIDESDB: idx 'idx_val' sampled=6 distinct=6 rec_per_key=1
test.t1 analyze status OK
# ANALYZE a table without secondary indexes
CREATE TABLE t2 (
Expand Down
58 changes: 58 additions & 0 deletions mysql-test/suite/tidesdb/r/tidesdb_concurrent_conflict.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
call mtr.add_suppression("TIDESDB:.*TDB_ERR_CONFLICT");
#
# Issue #77: Concurrent conflict detection
#
CREATE TABLE t (
i INT NOT NULL PRIMARY KEY,
x INT
) ENGINE=TidesDB;
INSERT INTO t VALUES (1,10),(2,20),(3,30),(4,40),(5,50);
connect con1, localhost, root,,;
connect con2, localhost, root,,;
# ---- TEST 1: Two UPDATEs on same row ----
connection con1;
START TRANSACTION;
UPDATE t SET x = 999 WHERE i = 1;
connection con2;
START TRANSACTION;
UPDATE t SET x = 888 WHERE i = 1;
COMMIT;
connection con1;
COMMIT;
Got one of the listed errors
connection default;
# con2 wins: x should be 888
SELECT * FROM t WHERE i = 1;
i x
1 888
# ---- TEST 2: UPDATE vs DELETE on same row ----
connection con1;
START TRANSACTION;
UPDATE t SET x = 777 WHERE i = 2;
connection con2;
START TRANSACTION;
DELETE FROM t WHERE i = 2;
COMMIT;
connection con1;
COMMIT;
Got one of the listed errors
connection default;
# con2 wins: row 2 should be gone
SELECT * FROM t WHERE i = 2;
i x
# Remaining rows intact
SELECT * FROM t ORDER BY i;
i x
1 888
3 30
4 40
5 50
# Cleanup
connection con1;
disconnect con1;
connection con2;
disconnect con2;
connection default;
DROP TABLE t;
#
# Done.
2 changes: 1 addition & 1 deletion mysql-test/suite/tidesdb/r/tidesdb_crud.result
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ t1 CREATE TABLE `t1` (
`score` decimal(10,2) DEFAULT NULL,
`bio` text DEFAULT NULL,
`born` date DEFAULT NULL
) ENGINE=TIDESDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
) ENGINE=TIDESDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
#
# ============================================
# TEST 2: INSERT — single row
Expand Down
10 changes: 10 additions & 0 deletions mysql-test/suite/tidesdb/r/tidesdb_data_home_dir.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Verify tidesdb_data_home_dir is visible and read-only
#
SHOW VARIABLES LIKE 'tidesdb_data_home_dir';
Variable_name Value
tidesdb_data_home_dir
SET GLOBAL tidesdb_data_home_dir = '/tmp/test';
ERROR HY000: Variable 'tidesdb_data_home_dir' is a read only variable
#
# Done.
2 changes: 1 addition & 1 deletion mysql-test/suite/tidesdb/r/tidesdb_encryption.result
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ t_enc2 CREATE TABLE `t_enc2` (
`name` varchar(50) DEFAULT NULL,
`amount` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=TIDESDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=2
) ENGINE=TIDESDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=2
INSERT INTO t_enc2 VALUES (1, 'alice', 100);
SELECT * FROM t_enc2;
id name amount
Expand Down
42 changes: 42 additions & 0 deletions mysql-test/suite/tidesdb/r/tidesdb_engine_status.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# SHOW ENGINE TIDESDB STATUS should return output
#
CREATE TABLE t1 (id INT PRIMARY KEY, val INT) ENGINE=TidesDB;
INSERT INTO t1 VALUES (1,10),(2,20),(3,30);
SHOW ENGINE TIDESDB STATUS;
Type Name Status
TIDESDB ================== TidesDB Engine Status ==================
Data directory: TIDESDB_DATA_DIR
Column families: N
Global sequence: N

--- Memory ---
Total system memory: N MB
Resolved memory limit: N MB
Memory pressure level: N
Total memtable bytes: N
Transaction memory bytes: N

--- Storage ---
Total SSTables: N
Open SSTable handles: N
Total data size: N bytes
Immutable memtables: N

--- Background ---
Flush pending: N
Flush queue size: N
Compaction queue size: N

--- Block Cache ---
Enabled: YES
Entries: N
Size: N bytes
Hits: N
Misses: N
Hit rate: N.N%
Partitions: N

DROP TABLE t1;
#
# Done.
86 changes: 0 additions & 86 deletions mysql-test/suite/tidesdb/r/tidesdb_fk_convert.result

This file was deleted.

114 changes: 114 additions & 0 deletions mysql-test/suite/tidesdb/r/tidesdb_index_stats.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#
# ============================================
# TEST 1: Index type reporting (issue #78)
# LSM tables should show LSM, not BTREE
# ============================================
#
CREATE TABLE t_lsm (
i INT NOT NULL PRIMARY KEY,
y INT,
KEY idx_y (y)
) ENGINE=TIDESDB USE_BTREE=0;
SHOW KEYS FROM t_lsm;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
t_lsm 0 PRIMARY 1 i A 2 NULL NULL LSM NO
t_lsm 1 idx_y 1 y A 2 NULL NULL YES LSM NO
DROP TABLE t_lsm;
#
# ============================================
# TEST 2: BTREE tables should show BTREE
# ============================================
#
CREATE TABLE t_btree (
i INT NOT NULL PRIMARY KEY,
y INT,
KEY idx_y (y)
) ENGINE=TIDESDB USE_BTREE=1;
SHOW KEYS FROM t_btree;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
t_btree 0 PRIMARY 1 i A 2 NULL NULL BTREE NO
t_btree 1 idx_y 1 y A 2 NULL NULL YES BTREE NO
DROP TABLE t_btree;
#
# ============================================
# TEST 3: Default (USE_BTREE=0) shows LSM
# ============================================
#
CREATE TABLE t_default (
i INT NOT NULL PRIMARY KEY,
y INT,
KEY idx_y (y)
) ENGINE=TIDESDB;
SHOW KEYS FROM t_default;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
t_default 0 PRIMARY 1 i A 2 NULL NULL LSM NO
t_default 1 idx_y 1 y A 2 NULL NULL YES LSM NO
DROP TABLE t_default;
#
# ============================================
# TEST 4: ANALYZE TABLE updates rec_per_key
# for non-unique secondary indexes (issue #74)
# ============================================
#
CREATE TABLE t_stats (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
k INT NOT NULL,
val VARCHAR(50),
KEY k_idx (k)
) ENGINE=TIDESDB;
# Insert 200 rows with only 2 distinct values for k
SELECT COUNT(*) AS total_rows FROM t_stats;
total_rows
200
# Before ANALYZE, optimizer may not estimate well
EXPLAIN SELECT * FROM t_stats WHERE k = 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t_stats ref k_idx k_idx 4 const 1
ANALYZE TABLE t_stats;
Table Op Msg_type Msg_text
test.t_stats analyze status Engine-independent statistics collected
test.t_stats analyze Note TIDESDB: CF 'test__t_stats' total_keys=N data_size=N bytes memtable=N bytes levels=5 read_amp=N cache_hit=N%
test.t_stats analyze Note TIDESDB: avg_key=N bytes avg_value=N bytes
test.t_stats analyze Note TIDESDB: level 1 sstables=N size=N bytes keys=N
test.t_stats analyze Note TIDESDB: level 2 sstables=N size=N bytes keys=N
test.t_stats analyze Note TIDESDB: level 3 sstables=N size=N bytes keys=N
test.t_stats analyze Note TIDESDB: level 4 sstables=N size=N bytes keys=N
test.t_stats analyze Note TIDESDB: level 5 sstables=N size=N bytes keys=N
test.t_stats analyze Note TIDESDB: idx CF 'test__t_stats__idx_k_idx' keys=N data_size=N bytes levels=5
test.t_stats analyze Note TIDESDB: idx 'k_idx' sampled=N distinct=N rec_per_key=N
test.t_stats analyze status OK
# After ANALYZE, the optimizer should estimate ~100 rows for k=0
EXPLAIN SELECT * FROM t_stats WHERE k = 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t_stats ref k_idx k_idx 4 const 100
DROP TABLE t_stats;
#
# ============================================
# TEST 5: ANALYZE with highly selective index
# ============================================
#
CREATE TABLE t_stats2 (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
code INT NOT NULL,
KEY code_idx (code)
) ENGINE=TIDESDB;
ANALYZE TABLE t_stats2;
Table Op Msg_type Msg_text
test.t_stats2 analyze status Engine-independent statistics collected
test.t_stats2 analyze Note TIDESDB: CF 'test__t_stats2' total_keys=N data_size=N bytes memtable=N bytes levels=5 read_amp=N cache_hit=N%
test.t_stats2 analyze Note TIDESDB: avg_key=N bytes avg_value=N bytes
test.t_stats2 analyze Note TIDESDB: level 1 sstables=N size=N bytes keys=N
test.t_stats2 analyze Note TIDESDB: level 2 sstables=N size=N bytes keys=N
test.t_stats2 analyze Note TIDESDB: level 3 sstables=N size=N bytes keys=N
test.t_stats2 analyze Note TIDESDB: level 4 sstables=N size=N bytes keys=N
test.t_stats2 analyze Note TIDESDB: level 5 sstables=N size=N bytes keys=N
test.t_stats2 analyze Note TIDESDB: idx CF 'test__t_stats2__idx_code_idx' keys=N data_size=N bytes levels=5
test.t_stats2 analyze Note TIDESDB: idx 'code_idx' sampled=N distinct=N rec_per_key=N
test.t_stats2 analyze status OK
# With 100 distinct values in 100 rows, rec_per_key should be ~1
EXPLAIN SELECT * FROM t_stats2 WHERE code = 50;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t_stats2 ref code_idx code_idx 4 const 1 Using index
DROP TABLE t_stats2;
#
# Done.
Loading
Loading