@@ -46,17 +46,22 @@ jobs:
4646
4747 - name : Setup test data in source MySQL
4848 run : |
49- mysqlsh -hlocalhost -P13306 -uroot -proot --sql -e "
49+ mysqlsh -hlocalhost -P13306 -uroot -proot --sql <<'EOF'
5050 CREATE DATABASE testdb;
5151 USE testdb;
52+ -- Normal table, which should be copied to MyDuck via duckdb's csv import
5253 CREATE TABLE users (
5354 id INT AUTO_INCREMENT PRIMARY KEY,
54- name VARCHAR(100)
55+ name VARCHAR(100),
56+ status ENUM('active', 'inactive', 'pending') DEFAULT 'pending'
5557 );
56- INSERT INTO users (name) VALUES ('test1'), ('test2'), ('test3');
58+ INSERT INTO users (name, status) VALUES
59+ ('test1', 'active'),
60+ ('test2', 'inactive'),
61+ ('test3', 'pending');
5762 -- Make a gap in the id sequence
58- INSERT INTO users VALUES (100, 'test100');
59- INSERT INTO users (name) VALUES ('test101');
63+ INSERT INTO users VALUES (100, 'test100', 'active' );
64+ INSERT INTO users (name, status ) VALUES ('test101', 'inactive ');
6065
6166 -- A table with non-default starting auto_increment value
6267 CREATE TABLE items (
6671 ) AUTO_INCREMENT=1000;
6772
6873 INSERT INTO items (v, name) VALUES (1, 'item1'), (2, 'item2'), (3, 'item3');
69- "
74+
75+ -- Table with UUID primary key
76+ -- For such tables, MySQL Shell generates nontrivial LOAD DATA statements
77+ -- to copy the data to MyDuck: LOAD DATA ... (@id, title, created_at) SET id = FROM_BASE64(@id),
78+ -- which can only be executed by the go-mysql-server framework for now.
79+ CREATE TABLE documents (
80+ id BINARY(16) PRIMARY KEY,
81+ title VARCHAR(200),
82+ status ENUM('draft', 'published', 'archived') DEFAULT 'draft',
83+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
84+ );
85+
86+ INSERT INTO documents (id, title, status) VALUES
87+ (UUID_TO_BIN(UUID()), 'Document 1', 'published'),
88+ (UUID_TO_BIN(UUID()), 'Document 2', 'draft');
89+ EOF
7090
7191 - name : Build and start MyDuck Server
7292 run : |
85105 --users false --ignore-version true
86106
87107 # Verify the data was copied
88- for table in users items; do
108+ for table in users items documents ; do
89109 mysqlsh -hlocalhost -P13306 -uroot -proot --sql -e "
90110 SELECT * FROM testdb.$table ORDER BY id;
91111 " | tee source_data_$table.tsv
96116 diff source_data_$table.tsv copied_data_$table.tsv
97117 done
98118
99-
119+
0 commit comments