engine.Insert can not autocommit #2
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/tidb#2
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Author: @elvizlai
engine.Insert can not autocommit
//test case:
Author: @lunny
Hi, I have copied the code and run in my macbook.
I think there is no error occupied this time.
Author: @elvizlai
@lunny every time the code runs, it inserted "a" and "b" to database. But it only succeed for the first run. From TiDB log, it show's the second time run missing
autocommit
So I tried using session commit instead. It works.
Author: @lunny
I open the tidb's log. It seems it's ok.
And @ngaut, What's the
Engine
column's value onINFORMATION_SCHEMA.TABLES
, 'MyISAM' OR 'InnoDB' or others?Author: @elvizlai
@lunny
check your log, they are not autocommit, it just insert to memory,but not commit to storage.
here is my log file when the first time run that code.
here is my log file for the second time run.
It looks like that the
autocommit
are missing. I thought maybe adding time.Sleep() at the end of the code to wait for autocommit, but that does not work.So I tried using session to commit(this works):
and the log:
Author: @lunny
So that maybe it's a driver's problem? @ngaut
Author: @ngaut
Thanks @lunny
I will take a look.
Author: @ngaut
Fixed! Thanks @lunny @ElvizLai
Please update tidb and try again
Author: @lunny
I think maybe we can close this issue. @ElvizLai
Author: @elvizlai
Done