This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 7627defc88 [fix](regression-test) Add test data for 
test_mysql_jdbc_catalog and fix mysql-5.7.yaml about UTF8 (#14749)
7627defc88 is described below

commit 7627defc88cb0b3a3b38aab7d4d0dc4b27ae61e5
Author: Tiewei Fang <[email protected]>
AuthorDate: Fri Dec 2 11:58:11 2022 +0800

    [fix](regression-test) Add test data for test_mysql_jdbc_catalog and fix 
mysql-5.7.yaml about UTF8 (#14749)
    
    Fix two things:
    1. Fix that the MySQL table displays the garbled code even if the UTF8 is 
specified for table.
    2. Fix that `test_mysql_jdbc_catalog.out` lack of returned data for table 
`ex_tb13`.
---
 .../docker-compose/mysql/init/03-create-table.sql  | 26 +++++++++++-----------
 .../docker-compose/mysql/init/04-insert.sql        |  4 ++--
 .../docker-compose/mysql/mysql-5.7.yaml            |  2 ++
 .../jdbc_catalog_p0/test_mysql_jdbc_catalog.out    |  8 +++++++
 4 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/docker/thirdparties/docker-compose/mysql/init/03-create-table.sql 
b/docker/thirdparties/docker-compose/mysql/init/03-create-table.sql
index b0e4890013..616335bd25 100644
--- a/docker/thirdparties/docker-compose/mysql/init/03-create-table.sql
+++ b/docker/thirdparties/docker-compose/mysql/init/03-create-table.sql
@@ -90,34 +90,34 @@ CREATE TABLE doris_test.ex_tb7 (
   `id` varchar(32) NULL DEFAULT "",
   `user_name` varchar(32) NULL DEFAULT "",
   `member_list` DECIMAL(10,3)
-);
+) engine=innodb charset=utf8;
 
 CREATE TABLE doris_test.ex_tb8 (
    `date` date NOT NULL COMMENT "",
    `uid` varchar(64) NOT NULL,
    `stat_type` int(11) NOT NULL COMMENT "",
    `price` varchar(255) NULL COMMENT "price"
-);
+) engine=innodb charset=utf8;
 
 CREATE TABLE doris_test.ex_tb9 (
    c_date date null
-);
+) engine=innodb charset=utf8;
 
 CREATE TABLE doris_test.ex_tb10 (
     `aa` varchar(200) NULL,
     `bb` int NULL,
     `cc` bigint NULL
-);
+) engine=innodb charset=utf8;
 
 CREATE TABLE doris_test.ex_tb11 (
  `aa` varchar(200) PRIMARY KEY,
  `bb` int NULL
-);
+) engine=innodb charset=utf8;
 
 CREATE TABLE doris_test.ex_tb12 (
  `cc` varchar(200) PRIMARY KEY,
  `dd` int NULL
-);
+) engine=innodb charset=utf8;
 
 CREATE TABLE doris_test.ex_tb13 (
      name varchar(128),
@@ -129,7 +129,7 @@ CREATE TABLE doris_test.ex_tb13 (
      country varchar(128),
      gender varchar(128),
      covid BOOLEAN
-);
+) engine=innodb charset=utf8;
 
 CREATE TABLE doris_test.ex_tb14 (
      tid varchar(128),
@@ -137,7 +137,7 @@ CREATE TABLE doris_test.ex_tb14 (
      dt  date,
      cmd varchar(128),
      dp_from varchar(128)
-);
+) engine=innodb charset=utf8;
 
 CREATE TABLE doris_test.ex_tb15 (
     col1 varchar(10) NULL ,
@@ -152,7 +152,7 @@ CREATE TABLE doris_test.ex_tb15 (
     col10 varchar(10) NULL ,
     col11 varchar(10) NULL ,
     col12 datetime NULL
-);
+) engine=innodb charset=utf8;
 
 CREATE TABLE doris_test.ex_tb16 (
    `id` bigint(20) NOT NULL COMMENT '',
@@ -162,7 +162,7 @@ CREATE TABLE doris_test.ex_tb16 (
    `modify_uid` bigint(20) NULL,
    `ctime` bigint(20) NULL,
    `mtime` bigint(20) NULL
-);
+) engine=innodb charset=utf8;
 
 CREATE TABLE doris_test.ex_tb17 (
   `id` bigint(20) NULL,
@@ -182,9 +182,9 @@ CREATE TABLE doris_test.ex_tb17 (
   `account_number` varchar(765) NULL,
   `currency_type` tinyint(4) NULL,
   `order_source` tinyint(4) NULL
-);
+) engine=innodb charset=utf8;
 
-create table ex_tb18 (
+create table doris_test.ex_tb18 (
     num_tinyint tinyint,
     num_tinyint2 tinyint unsigned,
     num_smallint SMALLINT,
@@ -206,7 +206,7 @@ create table ex_tb18 (
     text_value TEXT(123)
 ) engine=innodb charset=utf8;
 
-create table ex_tb19 (
+create table doris_test.ex_tb19 (
     date_value date,
     time_value time,
     year_value year,
diff --git a/docker/thirdparties/docker-compose/mysql/init/04-insert.sql 
b/docker/thirdparties/docker-compose/mysql/init/04-insert.sql
index 684a4137e2..be32888fd6 100644
--- a/docker/thirdparties/docker-compose/mysql/init/04-insert.sql
+++ b/docker/thirdparties/docker-compose/mysql/init/04-insert.sql
@@ -1112,10 +1112,10 @@ INSERT INTO doris_test.ex_tb17 
(id,media_order_id,supplier_id,agent_policy_type,
 (7,3,2,8,5297.81,9,3,23753694.2,96930000.64,'c',7,2,0,'b','e',1,5), 
(9,3,9,1,4785.38,1,5,95199488.12,94869703.42,'a',4,4,0,'c','d',2,4),
 (5,6,4,5,9137.82,2,7,26526675.7,90098303.36,'a',6,7,0,'d','e',4,1);
 
-INSERT INTO ex_tb18 VALUES
+INSERT INTO doris_test.ex_tb18 VALUES
 
(1,1,1,1,1,1,1,1,1,1,3.14,13.141,2342.23,'aa','asdawdasdaasdasd','aaa','bbbbbbbb','xaqwdqwdqwdqdwqwdqwdqd','asdadwqdqwddqwdsadqwdas'),
 (127,255,32767, 65535, 8388607, 16777215, 9223372036854775807, -2147483648, 
2147483647, 
4294967295,33.1415926,422113.1411231,2342.23123123,'aa','asdawdasdaasdasd','aaa','bbbbbbbb','xaqwdqwdqwdqd','asdadwqdqwdsadqwdas'),
 (-128,255,-32768, 65535, -8388608, 16777215, -9223372036854775808, 
-2147483648, 2147483647, 
4294967295,33.1415926,422113.1411231,2342.23123123,'aa','asdawdasdaasdasd','aaa','bbbbbbbb','xaqwdqwdqwdqd','asdas');
 
-INSERT INTO ex_tb19 VALUES
+INSERT INTO doris_test.ex_tb19 VALUES
 ('2022-11-27', '07:09:51', '2022', '2022-11-27 07:09:51', '2022-11-27 
07:09:51');
diff --git a/docker/thirdparties/docker-compose/mysql/mysql-5.7.yaml 
b/docker/thirdparties/docker-compose/mysql/mysql-5.7.yaml
index ce7e41fb55..01cebf3aa5 100644
--- a/docker/thirdparties/docker-compose/mysql/mysql-5.7.yaml
+++ b/docker/thirdparties/docker-compose/mysql/mysql-5.7.yaml
@@ -25,6 +25,8 @@ services:
     environment:
       MYSQL_ROOT_PASSWORD: 123456
       MYSQL_DATABASE: init_db
+      # set terminal charset
+      LANG: C.UTF-8
     ports:
       - ${DOCKER_MYSQL_57_EXTERNAL_PORT}:3306
     healthcheck:
diff --git a/regression-test/data/jdbc_catalog_p0/test_mysql_jdbc_catalog.out 
b/regression-test/data/jdbc_catalog_p0/test_mysql_jdbc_catalog.out
index 9c4a43e959..a92ab12c42 100644
--- a/regression-test/data/jdbc_catalog_p0/test_mysql_jdbc_catalog.out
+++ b/regression-test/data/jdbc_catalog_p0/test_mysql_jdbc_catalog.out
@@ -80,6 +80,14 @@ b    1
 c      1
 
 -- !ex_tb13 --
+张三0    11      1234567 123     321312  1999-02-13T00:00        中国      男       
false
+张三1    11      12345678        123     321312  1999-02-13T00:00        中国      
男       false
+张三2    11      12345671        123     321312  1999-02-13T00:00        中国      
男       false
+张三3    11      12345673        123     321312  1999-02-13T00:00        中国      
男       false
+张三4    11      123456711       123     321312  1999-02-13T00:00        中国      
男       false
+张三5    11      1232134567      123     321312  1999-02-13T00:00        中国      
男       false
+张三6    11      124314567       123     321312  1999-02-13T00:00        中国      
男       false
+张三7    11      123445167       123     321312  1998-02-13T00:00        中国      
男       false
 
 -- !ex_tb14 --
 123    2022-11-02      2022-11-02      8011    oppo


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to