mwild1 / luadbi

Multi-backend SQL database library for Lua
MIT License
42 stars 15 forks source link

MySQL 8: INSERT INTO does not work properly #79

Closed Robox-Corporation closed 3 months ago

Robox-Corporation commented 3 months ago

I don't know if it is something wrong with my code, but it seems every time I try to use INSERT INTO, execute returns true but the data doesn't show up. This is quite strange especially because looking in the IBD file for the table I tried to use INSERT INTO on, the data is there but it isn't used by MySQL. Even auto increment still works. Code: local dbconn = assert(require('DBI').Connect("MySQL","testdb","testuser","test","127.0.0.1")) local test = assert(dbconn:prepare('INSERT INTO systemalerts (text,bgcolor,hidden) VALUES ("test","test",0)')) print(test:execute())

Robox-Corporation commented 3 months ago

Never mind, I looked into the source code and discovered autocommit was off by default. Makes a lot of sense to why it was doing this.