You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
explicit txn is not handled properly in mysql handler. (http handler/bendsql work as expected)
how to reproduce:
create or replace database poc2;
use poc2;
create or replace table poc2.t_1 (str varchar);
begin;
insert into poc2.t_1 (str) values ('a'), ('b');
select 1/0;
commit;
select * from poc2.t_1; // <- expects empty resultset
mysql hander fails the above test:
mysql> create or replace database poc2;
Query OK, 0 rows affected (0.20 sec)
mysql> use poc2;
Database changed
mysql>
mysql>
mysql> create or replace table poc2.t_1 (str varchar);
Query OK, 0 rows affected (0.12 sec)
mysql> begin;
Query OK, 0 rows affected (0.03 sec)
mysql> insert into poc2.t_1 (str) values ('a'), ('b');
Query OK, 2 rows affected (0.21 sec)
mysql> select 1/0;
ERROR 1105 (HY000): BadArguments. Code: 1006, Text = error:
--> SQL:1:9
|
1 | select 1/0
| ^ divided by zero while evaluating function `divide(1, 0)`
.
mysql> commit;
Query OK, 0 rows affected (0.08 sec)
mysql> select * from poc2.t_1;
+------+
| str |
+------+
| a |
| b |
+------+
2 rows in set (0.17 sec)
Read 2 rows, 27.00 B in 0.036 sec., 56.2 rows/sec., 758.76 B/sec.
bendsql(http) ok:
root@localhost:8000/poc2> create or replace database poc2;
CREATE
OR REPLACE DATABASE poc2
root@localhost:8000/poc2> use poc2;
USE poc2
root@localhost:8000/poc2> create or replace table poc2.t_1 (str varchar);
CREATE
OR REPLACE TABLE poc2.t_1 (str varchar)
root@localhost:8000/poc2> begin;
BEGIN
root@localhost:8000/poc2> insert into poc2.t_1 (str) values ('a'), ('b');
INSERT INTO
poc2.t_1 (str)
VALUES
('a'),
('b')
root@localhost:8000/poc2> select 1/0;
error: APIError: ResponseError with 1006: divided by zero while evaluating function `divide(1, 0)`
root@localhost:8000/poc2> commit;
COMMIT
root@localhost:8000/poc2> select * from poc2.t_1;
SELECT
*
FROM
poc2.t_1
0 row read in 0.073 sec. Processed 0 row, 0 B (0 row/s, 0 B/s)
The text was updated successfully, but these errors were encountered:
Summary
explicit txn is not handled properly in mysql handler. (http handler/bendsql work as expected)
how to reproduce:
mysql hander fails the above test:
bendsql(http) ok:
The text was updated successfully, but these errors were encountered: