1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

feature: pron (#2908)

* feature: Special dictionary, we can pass with session veriable to modify codepaths and behaviour for testing and debugging
This commit is contained in:
Leonid Fedorov
2023-07-21 14:02:03 +03:00
committed by GitHub
parent 510bdd0e7b
commit 65cde8c894
14 changed files with 212 additions and 2 deletions

View File

@ -0,0 +1,36 @@
DROP DATABASE IF EXISTS pron;
CREATE DATABASE pron;
USE pron;
CREATE TABLE t
(
a double
) ENGINE=Columnstore;
INSERT INTO t VALUES(1.5707963267948966);
SHOW variables like 'columnstore_pron';
Variable_name Value
columnstore_pron
SELECT sin(a) from t;
sin(a)
1
SET columnstore_pron='{"megasinus": "123"}';
SHOW variables like 'columnstore_pron';
Variable_name Value
columnstore_pron {"megasinus": "123"}
SELECT sin(a) from t;
sin(a)
123
SET columnstore_pron='{"megasinus": "-200"}';
SHOW variables like 'columnstore_pron';
Variable_name Value
columnstore_pron {"megasinus": "-200"}
SELECT sin(a) from t;
sin(a)
-200
SET columnstore_pron='';
SHOW variables like 'columnstore_pron';
Variable_name Value
columnstore_pron
SELECT sin(a) from t;
sin(a)
1
DROP DATABASE pron;

View File

@ -0,0 +1,36 @@
# Here we test the usage of columnstore_pron dictionary
# Sine function has codepath checking the value of megasinus
# just for exmaple. Maybe deleted after another proper usages
--source ../include/have_columnstore.inc
--disable_warnings
DROP DATABASE IF EXISTS pron;
--enable_warnings
CREATE DATABASE pron;
USE pron;
CREATE TABLE t
(
a double
) ENGINE=Columnstore;
INSERT INTO t VALUES(1.5707963267948966);
SHOW variables like 'columnstore_pron';
SELECT sin(a) from t;
SET columnstore_pron='{"megasinus": "123"}';
SHOW variables like 'columnstore_pron';
SELECT sin(a) from t;
SET columnstore_pron='{"megasinus": "-200"}';
SHOW variables like 'columnstore_pron';
SELECT sin(a) from t;
SET columnstore_pron='';
SHOW variables like 'columnstore_pron';
SELECT sin(a) from t;
DROP DATABASE pron;