ClickHouse/tests/queries/0_stateless/00394_replaceall_vector_fixed.sql

26 lines
758 B
MySQL
Raw Normal View History

DROP TABLE IF EXISTS replaceall;
CREATE TABLE replaceall (str FixedString(3)) ENGINE = Memory;
2016-12-02 23:29:16 +00:00
INSERT INTO replaceall VALUES ('foo');
INSERT INTO replaceall VALUES ('boa');
INSERT INTO replaceall VALUES ('bar');
INSERT INTO replaceall VALUES ('bao');
2016-12-02 23:29:16 +00:00
SELECT
str,
replaceAll(str, 'o', '*') AS replaced
FROM replaceall
2016-12-02 23:29:16 +00:00
ORDER BY str ASC;
DROP TABLE replaceall;
2022-06-23 08:37:52 +00:00
set allow_deprecated_syntax_for_merge_tree=1;
CREATE TABLE replaceall (date Date DEFAULT today(), fs FixedString(16)) ENGINE = MergeTree(date, (date, fs), 8192);
INSERT INTO replaceall (fs) VALUES ('54db0d43009d\0\0\0\0'), ('fe2b58224766cf10'), ('54db0d43009d\0\0\0\0'), ('fe2b58224766cf10');
SELECT fs, replaceAll(fs, '\0', '*')
FROM replaceall
ORDER BY fs ASC;
DROP TABLE replaceall;