1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-18 21:44:02 +03:00
mariadb-AlexeyVorovich 64f1d541d0
MCOL-5519: new defaults in columnstore.cnf (#2894)
feat(charset)!: utf8 is a new charset default and utf8_general_ci is a new collation default in the engine configuration file shipped
---------

Co-authored-by: Leonid Fedorov <leonid.fedorov@mariadb.com>
Co-authored-by: mariadb-DanielLee <daniel.lee@mariadb.com>
2023-08-15 18:04:32 +03:00

43 lines
1.3 KiB
Plaintext

DROP DATABASE IF EXISTS mcs176_db;
CREATE DATABASE mcs176_db;
USE mcs176_db;
SET default_storage_engine=Columnstore;
CREATE TABLE t1 (a CHAR(1), b INT, c DATETIME, d DOUBLE);
INSERT INTO t1 VALUES (NULL, NULL, '0-0-0', NULL),('a', 12, '1212-12-12', 1.19691E+100),('b', 13, '1313-3-13 13:13:13', 2.1961E+18),('c', 14, '1414-4-14', 0.16191),('d', 15, '2015-5-15 15:15:15', 1.971917);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(1) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` datetime DEFAULT NULL,
`d` double DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
SELECT IF(10<20, 1, 2);
IF(10<20, 1, 2)
1
SELECT IF(STRCMP("hello","hi") = 0, "YES", "NO");
IF(STRCMP("hello","hi") = 0, "YES", "NO")
NO
SELECT a, IF(a='b', 10, 20) AS result FROM t1;
a result
NULL 20
a 20
b 10
c 20
d 20
SELECT b, IF(b<=13, 'Less than or equal to 13', 'Greater than 13') AS result FROM t1;
b result
NULL Greater than 13
12 Less than or equal to 13
13 Less than or equal to 13
14 Greater than 13
15 Greater than 13
SELECT c, IF(c>0, 'date', 'zero date') AS result FROM t1;
c result
0000-00-00 00:00:00 zero date
1212-12-12 00:00:00 date
1313-03-13 13:13:13 date
1414-04-14 00:00:00 date
2015-05-15 15:15:15 date
DROP DATABASE mcs176_db;