mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-04-20 09:07:44 +03:00
* Update mcol_2000.test * Update mcs117_create_utf8.test * Update mcs12_alter_table.test * Update mcs13_alter_table_negative.test * Update mcs169_bin_functions.test * Update mcs171_null_functions.test * Update mcs173_coalesce_function.test * Update mcs174_case_function.test * Update mcs175_convert_functions.test * Update mcs176_if_function.test * Update mcs178_adddate_function.test * Update mcs179_addtime_function.test * Update mcs180_ascii_function.test * Update mcs181_between_and.test * Update mcs182_char_length_function.test * Update mcs183_date_function.test * Update mcs184_day_function.test * Update mcs185_dayname_function.test * Update mcs186_dayofyear_function.test * Update mcs187_dayofmonth_function.test * Update mcs1_create_table_data_types.test * Update mcs19_grant_revoke.test * Update mcs229_data_compression_type.test * Update mcs28_load_data_local_infile.test * Update mcs2_create_table_valid_names.test * Update mcs5_create_table_from_other_tables.test * Update mcs74_check_constraint.test * Update mcs7_create_table_with_metadata.test * Update mcs87_alter_column.test * Update mcs8_create_table_with_constraints.test * Update disabled.def * Update mcs19_grant_revoke.test * Update mcs19_grant_revoke.test * Update mcs19_grant_revoke.test
45 lines
1.2 KiB
Plaintext
45 lines
1.2 KiB
Plaintext
#
|
|
# Test CONVERT, CONV functions
|
|
# Author: Bharath, bharath.bokka@mariadb.com
|
|
#
|
|
-- source ../include/have_columnstore.inc
|
|
|
|
--disable_warnings
|
|
DROP DATABASE IF EXISTS mcs175_db;
|
|
--enable_warnings
|
|
|
|
CREATE DATABASE mcs175_db;
|
|
USE mcs175_db;
|
|
|
|
SET default_storage_engine=Columnstore;
|
|
|
|
CREATE TABLE t1 (a CHAR(1), b INT, c DATETIME, d DOUBLE);
|
|
INSERT INTO t1 VALUES ('', 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);
|
|
--replace_regex /( COLLATE=latin1_swedish_ci)//
|
|
SHOW CREATE TABLE t1;
|
|
|
|
SELECT CONVERT(123, CHAR);
|
|
SELECT CONVERT("14:06:10", TIME);
|
|
SELECT CONVERT("columnstore" USING latin1);
|
|
SELECT CONVERT('abcd', BINARY);
|
|
SELECT CONVERT(-123, UNSIGNED);
|
|
|
|
SELECT CONV(123, 10, 2);
|
|
SELECT CONV(123, 8, 2);
|
|
SELECT CONV(2011, 10, 16);
|
|
SELECT CONV(101011, 2, 10);
|
|
|
|
SELECT CONVERT(c, DATE) FROM t1;
|
|
SELECT CONVERT(c, TIME) FROM t1;
|
|
SELECT CONVERT(b, CHAR) FROM t1;
|
|
SELECT CONVERT(b, SIGNED) FROM t1;
|
|
|
|
SELECT b, CONV(b, 10, 2) FROM t1;
|
|
SELECT b, CONV(b, 10, 8) FROM t1;
|
|
SELECT b, CONV(b, 10, 16) FROM t1;
|
|
SELECT d, CONV(d, 10, 2) FROM t1;
|
|
SELECT d, CONV(d, 10, 16) FROM t1;
|
|
|
|
# Clean UP
|
|
DROP DATABASE mcs175_db;
|