1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-21 19:45:56 +03:00

79 lines
4.4 KiB
Plaintext

-- source ../include/have_columnstore.inc
--disable_warnings
DROP DATABASE IF EXISTS unsigned_bug5628_db;
--enable_warnings
CREATE DATABASE unsigned_bug5628_db;
USE unsigned_bug5628_db;
CREATE TABLE bug5628 (c1 TINYINT UNSIGNED DEFAULT NULL ) ENGINE=Columnstore;
INSERT INTO bug5628 (c1) VALUE (127);
INSERT INTO bug5628 (c1) VALUE (128);
SELECT test, t1.c1 FROM ( SELECT 127 AS test FROM DUAL ) t INNER JOIN bug5628 t1 ON t.test=t1.c1 ORDER BY t1.c1;
SELECT test, t1.c1 FROM ( SELECT 128 AS test FROM DUAL ) t INNER JOIN bug5628 t1 ON t.test=t1.c1 ORDER BY t1.c1;
DROP TABLE IF EXISTS bug5628;
CREATE TABLE bug5628 (c1 SMALLINT UNSIGNED DEFAULT NULL ) ENGINE=Columnstore;
INSERT INTO bug5628 (c1) VALUE (32767);
INSERT INTO bug5628 (c1) VALUE (32768);
SELECT test, t1.c1 FROM ( SELECT 32767 AS test FROM DUAL ) t INNER JOIN bug5628 t1 ON t.test=t1.c1 ORDER BY t1.c1;
SELECT test, t1.c1 FROM ( SELECT 32768 AS test FROM DUAL ) t INNER JOIN bug5628 t1 ON t.test=t1.c1 ORDER BY t1.c1;
DROP TABLE IF EXISTS bug5628;
CREATE TABLE bug5628 (c1 INT UNSIGNED DEFAULT NULL ) ENGINE=Columnstore;
INSERT INTO bug5628 (c1) VALUE (2147483647);
INSERT INTO bug5628 (c1) VALUE (2147483648);
SELECT test, t1.c1 FROM ( SELECT 2147483647 AS test FROM DUAL ) t INNER JOIN bug5628 t1 ON t.test=t1.c1 ORDER BY t1.c1;
SELECT test, t1.c1 FROM ( SELECT 2147483648 AS test FROM DUAL ) t INNER JOIN bug5628 t1 ON t.test=t1.c1 ORDER BY t1.c1;
DROP TABLE IF EXISTS bug5628;
CREATE TABLE bug5628 (c1 BIGINT UNSIGNED DEFAULT NULL ) ENGINE=Columnstore;
INSERT INTO bug5628 (c1) VALUE (9223372036854775807);
INSERT INTO bug5628 (c1) VALUE (9223372036854775808);
SELECT test, t1.c1 FROM ( SELECT 9223372036854775807 AS test FROM DUAL ) t INNER JOIN bug5628 t1 ON t.test=t1.c1 ORDER BY t1.c1;
SELECT test, t1.c1 FROM ( SELECT 9223372036854775808 AS test FROM DUAL ) t INNER JOIN bug5628 t1 ON t.test=t1.c1 ORDER BY t1.c1;
DROP TABLE IF EXISTS bug5628;
CREATE TABLE bug5628A (c1 TINYINT DEFAULT NULL,
c2 SMALLINT DEFAULT NULL,
c3 INT DEFAULT NULL,
c4 BIGINT DEFAULT NULL
) ENGINE=Columnstore;
CREATE TABLE bug5628B (c1 TINYINT UNSIGNED DEFAULT NULL,
c2 SMALLINT UNSIGNED DEFAULT NULL,
c3 INT UNSIGNED DEFAULT NULL,
c4 BIGINT UNSIGNED DEFAULT NULL
) ENGINE=Columnstore;
INSERT INTO bug5628A (c1, c2, c3, c4) VALUES (-126, -32766, -2147483646, -9223372036854775806);
INSERT INTO bug5628B (c1, c2, c3, c4) VALUES (130, 32770, 2147483650, 9223372036854775810);
INSERT INTO bug5628A (c1, c2, c3, c4) VALUES (127, 32766, 2147483646, 9223372036854775806);
INSERT INTO bug5628B (c1, c2, c3, c4) VALUES (127, 32766, 2147483646, 9223372036854775806);
INSERT INTO bug5628B (c1, c2, c3, c4) VALUES (125, 32765, 2147483645, 9223372036854775805);
SELECT t1.c1, t2.c1 FROM bug5628A AS t1 INNER JOIN bug5628B t2 ON t1.c1=t2.c1 ORDER BY t1.c1;
SELECT t1.c2, t2.c2 FROM bug5628A AS t1 INNER JOIN bug5628B t2 ON t1.c2=t2.c2 ORDER BY t1.c2;
SELECT t1.c3, t2.c3 FROM bug5628A AS t1 INNER JOIN bug5628B t2 ON t1.c3=t2.c3 ORDER BY t1.c3;
SELECT t1.c4, t2.c4 FROM bug5628A AS t1 INNER JOIN bug5628B t2 ON t1.c4=t2.c4 ORDER BY t1.c4;
SELECT t1.c1, t2.c1, t1.c4, t2.c4 FROM bug5628A AS t1 INNER JOIN bug5628B t2 ON t1.c1=t2.c1 AND t1.c4=t2.c4 ORDER BY t1.c1;
SELECT t1.c1, t2.c1 FROM bug5628A AS t1 LEFT JOIN bug5628B t2 ON t1.c1=t2.c1 ORDER BY t1.c1;
SELECT t1.c2, t2.c2 FROM bug5628A AS t1 LEFT JOIN bug5628B t2 ON t1.c2=t2.c2 ORDER BY t1.c2;
SELECT t1.c3, t2.c3 FROM bug5628A AS t1 LEFT JOIN bug5628B t2 ON t1.c3=t2.c3 ORDER BY t1.c3;
SELECT t1.c4, t2.c4 FROM bug5628A AS t1 LEFT JOIN bug5628B t2 ON t1.c4=t2.c4 ORDER BY t1.c4;
SELECT t1.c1, t2.c1, t1.c4, t2.c4 FROM bug5628A AS t1 LEFT JOIN bug5628B t2 ON t1.c1=t2.c1 AND t1.c4=t2.c4 ORDER BY t1.c1;
SELECT t1.c1, t2.c1 FROM bug5628A AS t1 RIGHT JOIN bug5628B t2 ON t1.c1=t2.c1 ORDER BY t2.c1;
SELECT t1.c2, t2.c2 FROM bug5628A AS t1 RIGHT JOIN bug5628B t2 ON t1.c2=t2.c2 ORDER BY t2.c2;
SELECT t1.c3, t2.c3 FROM bug5628A AS t1 RIGHT JOIN bug5628B t2 ON t1.c3=t2.c3 ORDER BY t2.c3;
SELECT t1.c4, t2.c4 FROM bug5628A AS t1 RIGHT JOIN bug5628B t2 ON t1.c4=t2.c4 ORDER BY t2.c4;
SELECT t1.c1, t2.c1, t1.c4, t2.c4 FROM bug5628A AS t1 RIGHT JOIN bug5628B t2 ON t1.c1=t2.c1 AND t1.c4=t2.c4 ORDER BY t2.c1;
DROP TABLE IF EXISTS bug5628A;
DROP TABLE IF EXISTS bug5628B;
# Clean UP
DROP DATABASE unsigned_bug5628_db;