mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-04-18 21:44:02 +03:00
1. Extend the calpontsys.syscolumn system catalog table with a new column, 'charsetnum'. 'charsetnum' field is set to the 'number' member of the 'charset_info_st' struct defined in the server in m_ctype.h. For CHAR/VARCHAR/TEXT column types, 'charset_info_st' is initialized to the charset/collation of the column, which is set at the column-level or at the table-level in the DDL. For BLOB/VARBINARY binary column types, 'charset_info_st' is initialized to my_charset_bin (charsetnum=63). For all other column types, charsetnum is set to 0. 2. Add support for the newly added 'charsetnum' column in the automatic system catalog upgrade logic in dbbuilder. For existing table definitions, charsetnum for the column is defaulted to 0. 3. Add MTR test case that creates a few table definitions with a range of charset/collation combinations and queries the calpontsys.syscolumn system catalog table with the charsetnum field for the columns in the table DDLs.
48 lines
1.8 KiB
SQL
48 lines
1.8 KiB
SQL
-- SYSTABLE
|
|
create database if not exists calpontsys;
|
|
|
|
use calpontsys;
|
|
|
|
drop table if exists systable restrict;
|
|
drop table if exists syscolumn restrict;
|
|
|
|
create table if not exists systable (tablename varchar(128),
|
|
`schema` varchar(128),
|
|
objectid int,
|
|
createdate date,
|
|
lastupdate date,
|
|
init int,
|
|
next int,
|
|
numofrows int,
|
|
avgrowlen int,
|
|
numofblocks int,
|
|
autoincrement int,
|
|
auxcolumnoid int not null default 0) engine=columnstore comment='SCHEMA SYNC ONLY';
|
|
|
|
-- SYSCOLUMN
|
|
create table if not exists syscolumn (`schema` varchar(128),
|
|
tablename varchar(128),
|
|
columnname varchar(128),
|
|
objectid integer,
|
|
dictobjectid integer,
|
|
listobjectid integer,
|
|
treeobjectid integer,
|
|
datatype integer,
|
|
columnlength integer,
|
|
columnposition integer,
|
|
lastupdate date,
|
|
defaultvalue varchar(64),
|
|
nullable integer,
|
|
scale integer,
|
|
prec integer,
|
|
autoincrement char(1),
|
|
distcount integer,
|
|
nullcount integer,
|
|
minvalue varchar(64),
|
|
`maxvalue` varchar(64),
|
|
compressiontype integer,
|
|
nextvalue bigint,
|
|
charsetnum int not null default 0) engine=columnstore comment='SCHEMA SYNC ONLY';
|
|
|
|
DELIMITER ;
|