1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-4480: TEXT type added for alter table add column (#3221)

This commit is contained in:
Leonid Fedorov
2024-06-27 17:22:41 +04:00
committed by GitHub
parent d6db3552c3
commit 54331e1231
7 changed files with 61 additions and 7 deletions

View File

@ -0,0 +1,21 @@
DROP DATABASE IF EXISTS MCOL_5175;
CREATE DATABASE MCOL_5175;
USE MCOL_5175;
create table testtext2 ( myvalue varchar(100) )engine=Columnstore CHARSET=utf8;
show create table testtext2;
Table Create Table
testtext2 CREATE TABLE `testtext2` (
`myvalue` varchar(100) DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
alter table testtext2 add column myvalue2 text;
show create table testtext2;
Table Create Table
testtext2 CREATE TABLE `testtext2` (
`myvalue` varchar(100) DEFAULT NULL,
`myvalue2` text DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
insert into testtext2 (myvalue2) VALUES ('myvalue');
select * from testtext2;
myvalue myvalue2
NULL myvalue
DROP DATABASE MCOL_5175;

View File

@ -0,0 +1,22 @@
#
# Alter table add column
# Author: Bharath, bharath.bokka@mariadb.com
#
-- source include/have_innodb.inc
-- source ../include/have_columnstore.inc
--disable_warnings
DROP DATABASE IF EXISTS MCOL_5175;
--enable_warnings
CREATE DATABASE MCOL_5175;
USE MCOL_5175;
create table testtext2 ( myvalue varchar(100) )engine=Columnstore CHARSET=utf8;
show create table testtext2;
alter table testtext2 add column myvalue2 text;
show create table testtext2;
insert into testtext2 (myvalue2) VALUES ('myvalue');
select * from testtext2;
DROP DATABASE MCOL_5175;

View File

@ -11,4 +11,9 @@ INSERT INTO src VALUES (1, "Pretty Bloby Thing", "This is some text");
select * from src where c0=1 and substr(cLT, 1, 4)="This";
c0 cLB cLT
1 Pretty Bloby Thing This is some text
ALTER TABLE src ADD COLUMN (cLT2 LONGTEXT);
UPDATE src SET cLT2="My Friday Night" where c0=1;
select * from src where c0=1 and substr(cLT, 1, 4)="This";
c0 cLB cLT cLT2
1 Pretty Bloby Thing This is some text My Friday Night
DROP DATABASE `mcol_4758`;

View File

@ -11,9 +11,9 @@ INSERT INTO src VALUES (1, "Pretty Bloby Thing", "This is some text");
select * from src where c0=1 and substr(cLT, 1, 4)="This";
# To be uncommented when MCOL-4480 is fixed
#ALTER TABLE src ADD COLUMN (cLT2 LONGTEXT);
#UPDATE src SET cLT2="My Friday Night" where c0=1;
#select * from src where c0=1 and substr(cLT, 1, 4)="This";
ALTER TABLE src ADD COLUMN (cLT2 LONGTEXT);
UPDATE src SET cLT2="My Friday Night" where c0=1;
select * from src where c0=1 and substr(cLT, 1, 4)="This";
# cleanup
DROP DATABASE `mcol_4758`;