Skip to content

Chinese garbled in "select" subquery #736

@yexiaoli88

Description

@yexiaoli88
  • dble version: 5.6.29-dble-9.9.9.9-c51d005-20180927104851
  • preconditions :
REATE TABLE a_test(`id` int(10) unsigned NOT NULL,`t_id` int(10) unsigned NOT NULL DEFAULT '0',`name` char(120) NOT NULL DEFAULT '',`pad` int(11) NOT NULL,PRIMARY KEY (`id`),KEY `k_1` (`t_id`))DEFAULT CHARSET=UTF8;
insert into a_test values(1,1,'test中id为1',1),(2,2,'test_2',2),(3,3,'test中id为3',4),(4,4,'$test$4',3),(5,5,'test...5',1),(6,6,'test6',6);
  • configs:

schema.xml

<table name="a_test" primaryKey="id" dataNode="dn1,dn2,dn3,dn4" rule="mod-long" />

  • steps:
    step1. query in dble
mysql> select * from a_test;
+----+------+---------------+-----+
| id | t_id | name          | pad |
+----+------+---------------+-----+
|  2 |    2 | test_2        |   2 |
|  6 |    6 | test6         |   6 |
|  4 |    4 | $test$4       |   3 |
|  1 |    1 | test中id为1   |   1 |
|  5 |    5 | test...5      |   1 |
|  3 |    3 | test中id为3   |   4 |
+----+------+---------------+-----+
6 rows in set (0.01 sec)

mysql> select (select name from a_test order by id limit 1);
+-------------------------------------------------+
| ( SELECT name FROM a_test ORDER BY id LIMIT 1 ) |
+-------------------------------------------------+
| test?id?1                                       |
+-------------------------------------------------+
1 row in set (0.01 sec)

step2 query in mysql:

mysql> select * from a_test;
+----+------+---------------+-----+
| id | t_id | name          | pad |
+----+------+---------------+-----+
|  1 |    1 | test中id为1   |   1 |
|  2 |    2 | test_2        |   2 |
|  3 |    3 | test中id为3   |   4 |
|  4 |    4 | $test$4       |   3 |
|  5 |    5 | test...5      |   1 |
|  6 |    6 | test6         |   6 |
+----+------+---------------+-----+
6 rows in set (0.00 sec)

mysql> select (select name from a_test order by id limit 1);
+-----------------------------------------------+
| (select name from a_test order by id limit 1) |
+-----------------------------------------------+
| test中id为1                                   |
+-----------------------------------------------+
1 row in set (0.00 sec)

  • expect result:
    1 step1 should get the same results as step2

Metadata

Metadata

Assignees

Labels

complex-queryresolveproblem has been fixed by developerverifiedissue's resolve was verified by tester

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions