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: INSERT INTO table error, but some data can be inserted successfully #965

Closed
2 of 3 tasks
davidshiz opened this issue Nov 17, 2022 · 5 comments
Closed
2 of 3 tasks
Assignees
Labels
A-bug Something isn't working

Comments

@davidshiz
Copy link
Collaborator

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Describe the problem

When the INSERT INTO statement error, but unexpected some data can be inserted successfully.
All data should not be inserted into the table.

mysql> create table t (a int);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into t values (1), ('a');
ERROR 1366 (HY000): Incorrect integer value: 'a' for column 'a' at row 2

mysql> select * from t;
+------+
| a    |
+------+
|    1 |
+------+
1 row in set (0.00 sec)

Expected behavior

mysql> create table t (a int);
Query OK, 0 rows affected (0.00 sec)

mysql> insert into t values (1), ('a');
ERROR 1366 (HY000): Incorrect integer value: 'a' for column 'a' at row 2

mysql> select * from t;
Empty set (0.00 sec)

How To Reproduce

drop table if exists t;
create table t (a int);
insert into t values (1), ('a');
select * from t;

Environment

root@localhost:/# /stonedb57/install/bin/mysqld --version
/stonedb57/install/bin/mysqld  Ver 5.7.36-StoneDB for Linux on x86_64 (build-)
build information as follow:
        Repository address: https://github.com/stoneatom/stonedb.git:stonedb-5.7-dev
        Branch name: stonedb-5.7-dev
        Last commit ID: d0c2e01b6
        Last commit time: Date:   Wed Nov 2 19:58:00 2022 +0800
        Build time: Date: Sun 06 Nov 2022 08:50:06 AM UTC
root@ub01:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"

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

  • Yes, I will!
@davidshiz davidshiz added the A-bug Something isn't working label Nov 17, 2022
@haitaoguan
Copy link
Collaborator

The tianmu engine not support transaction

@davidshiz
Copy link
Collaborator Author

davidshiz commented Nov 22, 2022

It is recommended to give users a warning message that transactions are not supported, so as not to mislead users into thinking that all data has not been written, but in fact some data has been inserted successfully

@adofsauron
Copy link
Collaborator

Turn off the insert buffer and try again

@isredstar isredstar self-assigned this Dec 2, 2022
@isredstar
Copy link
Collaborator

@davidshiz When the tianmu_insert_delayed parameter is off,the question will be resolved.

mysql> select * from t_insert;
+------+
| a    |
+------+
|    1 |
|    1 |
|    1 |
+------+
3 rows in set (0.00 sec)

mysql> insert into t_insert values (1), ('a');
ERROR 1366 (HY000): Incorrect integer value: 'a' for column 'a' at row 2
mysql> select * from t_insert;
+------+
| a    |
+------+
|    1 |
|    1 |
|    1 |
+------+
3 rows in set (0.00 sec)

@wisehead
Copy link
Collaborator

I close it for now, looks like its related to tianmu_insert_delayed parameter.

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
Projects
None yet
Development

No branches or pull requests

5 participants