@@ -137,4 +137,52 @@ public void test_mariadb_aria() throws Throwable {
137
137
SchemaObject table = repository .findTable ("test" );
138
138
Assert .assertTrue (table != null );
139
139
}
140
+
141
+ @ Test
142
+ public void test_polardb_x () throws Throwable {
143
+ SchemaRepository repository = new SchemaRepository (JdbcConstants .MYSQL );
144
+ repository .setDefaultSchema ("test" );
145
+
146
+ String sql1 = "CREATE TABLE `test1` (\n " + " `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n "
147
+ + " `serialNo` varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',\n "
148
+ + " `user_id` int(11) DEFAULT NULL COMMENT '用户id',\n " + " PRIMARY KEY (`id`)\n "
149
+ + ") ENGINE = InnoDB PARTITION BY KEY(`tenant_id`,`id`)\n " + "PARTITIONS 21 tablegroup = `tg_p_msg`" ;
150
+ repository .console (sql1 );
151
+ SchemaObject table = repository .findTable ("test1" );
152
+ Assert .assertTrue (table != null );
153
+
154
+
155
+ String sql2 = "CREATE TABLE `test2` (\n " + " `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n "
156
+ + " `serialNo` varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',\n "
157
+ + " `user_id` int(11) DEFAULT NULL COMMENT '用户id',\n " + " PRIMARY KEY (`id`)\n "
158
+ + ") ENGINE = InnoDB single" ;
159
+ repository .console (sql2 );
160
+ table = repository .findTable ("test2" );
161
+ Assert .assertTrue (table != null );
162
+
163
+
164
+ String sql3 = "CREATE TABLE `test3` (\n " + " `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n "
165
+ + " `serialNo` varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',\n "
166
+ + " `user_id` int(11) DEFAULT NULL COMMENT '用户id',\n " + " PRIMARY KEY (`id`)\n "
167
+ + ") ENGINE = InnoDB locality = 'dn=polardbx-ng28-dn-1,polardbx-ng28-dn-2'" ;
168
+ repository .console (sql3 );
169
+ table = repository .findTable ("test3" );
170
+ Assert .assertTrue (table != null );
171
+
172
+ String sql4 = "CREATE TABLE test4(\n " + " order_id int AUTO_INCREMENT primary key,\n "
173
+ + " customer_id int,\n " + " country varchar(64),\n " + " city varchar(64),\n "
174
+ + " order_time datetime not null)\n " + "PARTITION BY LIST COLUMNS(country,city)\n " + "(\n "
175
+ + " PARTITION p1 VALUES IN (('China','Shanghai')) LOCALITY = 'dn=polardbx-ng28-dn-2',\n "
176
+ + " PARTITION p2 VALUES IN (('China','Beijing')) LOCALITY = 'dn=polardbx-ng28-dn-2',\n "
177
+ + " PARTITION p3 VALUES IN (('China','Hangzhou')) ,\n "
178
+ + " PARTITION p4 VALUES IN (('China','Nanjing')) ,\n "
179
+ + " PARTITION p5 VALUES IN (('China','Guangzhou')) ,\n "
180
+ + " PARTITION p6 VALUES IN (('China','Shenzhen')) ,\n "
181
+ + " PARTITION p7 VALUES IN (('China','Wuhan')) ,\n "
182
+ + " PARTITION p8 VALUES IN (('America','New York'))\n "
183
+ + ") LOCALITY = 'dn=polardbx-ng28-dn-0,polardbx-ng28-dn-1';" ;
184
+ repository .console (sql4 );
185
+ table = repository .findTable ("test4" );
186
+ Assert .assertTrue (table != null );
187
+ }
140
188
}
0 commit comments