[08] Error: during query execution.General error: 1366 Incorrect integer value: ''

gamunden

New member
Our environment:
DaDaBIK version: 5.1.2 PRO
operating system: Ubuntu 16.04
PHP Version: 7.0.22-0ubuntu0.16.04.1
mysql version: 5.7.19-0ubuntu0.16.04.1
Web server: Apache/2.4.18 (Ubuntu)
Client: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36

We Recently had to move our database and DaDaBik to a new server, old server was on:
DaDaBIK version: 5.1.2 PRO
operating system: Ubuntu 15.04
PHP Version: 5.6.4-4ubuntu6.4
mysql version: 5.6.28-0ubuntu0.15.04.1-log
Web server: Apache/2.4.10 (Ubuntu)
Client: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36

Now when we try to do an insert we get the following :

Your SQL query (for debugging purpose): INSERT INTO `ac` (`index`, `ac`) VALUES ('', 'test')

[08] Error: during query execution. INSERT INTO `ac` (`index`, `ac`) VALUES ('', 'test')
The DBMS server said: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'index' at row 1

Is there a setting I need to change to allow DaDaBik to work correctly again?

Thank you,

George
 

eugenio

Administrator
Staff member
Hello,
is "index" a field you have in your insert form? You left it blank on purpose? What do you want to insert in the database, a NULL value?

Best,
 

gamunden

New member
Thank you so much for responding.

Yes, index is the name of the primary key field. After doing a little research I discovered that mySQL made a change between version 5.6 and 5.7. This change is the cause of the problem. Where as before the migration to the new server DaDaBik would insert blank fields as null and mySQL would autoincrement the primary key . But with the change in mySQL 5.7 null does not cause and autoincrement in the primary key as null is not an integer value.

Thanks for your help and any suggestions.
 

eugenio

Administrator
Staff member
Hello,
if index is the primary key, it cannot be NULL anyway, probably you should choose another field (e.g. an additional autoincrement field) as PK and declare index as unique.

Best,
 
Top