Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; The query result data is incomplete #289

Closed
1 task
shangyanwen opened this issue Jul 21, 2022 · 5 comments
Assignees
Labels
A-bug Something isn't working prio: high High priority

Comments

@shangyanwen
Copy link
Contributor

Describe the problem

CREATE TABLE t1 (name varchar(255))engine=stonedb;
CREATE TABLE t2 (name varchar(255), n int, KEY (name(3)))engine=stonedb;
INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa  '), ('aa');
INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc   ',3);
INSERT INTO t2 VALUES (concat('cc ', 0x06), 4);
INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7);

SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; 
##The error results are as follows
+------+--------------+------+
| name | LENGTH(name) | n    |
+------+--------------+------+
| cc   |            3 |    7 |
+------+--------------+------+
1 row in set (0.01 sec)

Expected behavior

##The following is:innodb test result

SELECT name, LENGTH(name), n FROM t2 WHERE name='cc ';
+-------+--------------+------+
| name  | LENGTH(name) | n    |
+-------+--------------+------+
| cc    |            5 |    3 |
| cc    |            2 |    5 |
| cc    |            3 |    7 |
+-------+--------------+------+
3 rows in set (0.01 sec)

How To Reproduce

CREATE TABLE t1 (name varchar(255))engine=stonedb;
CREATE TABLE t2 (name varchar(255), n int, KEY (name(3)))engine=stonedb;
INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa  '), ('aa');
INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc   ',3);
INSERT INTO t2 VALUES (concat('cc ', 0x06), 4);
INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7);

SELECT name, LENGTH(name), n FROM t2 WHERE name='cc ';

Environment

  1. StoneDB for mysql5.7 (release)
  2. Ubuntu 20.04.4

Are you interested in submitting a PR to solve the problem?

  • Yes, I will!
@shangyanwen shangyanwen added the A-bug Something isn't working label Jul 21, 2022
@hustjieke hustjieke added the prio: high High priority label Jul 24, 2022
@hustjieke hustjieke self-assigned this Jul 24, 2022
@hustjieke hustjieke added this to the stonedb_5.7_v1.0.0 milestone Jul 24, 2022
@hustjieke
Copy link
Collaborator

hustjieke commented Jul 24, 2022

With both stonedb_insert_delayed=0/1:

mysql> select * from t2;
+-------+------+
| name  | n    |
+-------+------+
| bb    |    1 |
| aa    |    2 |
| cc    |    3 |
| cc   |    4 |
| cc    |    5 |
| bb    |    6 |
| cc    |    7 |
+-------+------+

distinct not work?

mysql> select distinct name from t2;
+-------+
| name  |
+-------+
| bb    |
| aa    |
| cc    |
| cc   |
| cc    |
| bb    |
| cc    |
+-------+
7 rows in set (0.01 sec)

@shangyanwen
Copy link
Contributor Author

stonedb 5.7_v1.0.1,Regression This bug still exists

@duanfuxiang0
Copy link
Contributor

ACK

@duanfuxiang0
Copy link
Contributor

#247

@shangyanwen
Copy link
Contributor Author

If the verification is successful, the space problem is not handled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bug Something isn't working prio: high High priority
Projects
None yet
Development

No branches or pull requests

3 participants