General error: 1364 Field 'item_id' doesn't have a default value: INSERT INTO {queue}

Hello,

 My site  work on drupal and mysql. Suddenly, it start to give me

"PDOException: SQLSTATE[HY000]: General error: 1364 Field 'item_id' doesn't have a default value: INSERT INTO {queue}........ "

"PDOException: SQLSTATE[HY000]: General error: 1364 Field 'vid' doesn't have a default value: INSERT INTO {node_revision}....."

 

The same sentence appears with different table name and variables whenever I do any action on the website.

 

The database is not in “Strict mode”. I added this

sql_mode = ""

to my.ini

 

but still not working

 

Please help


Thank you.
Hassan AlhusseiniAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
check the table design of fields item_id and vid, they cannot be NULL, so a non NULL value MUST be provided in your Insert SQL statements.
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
alternatively, set these fields to be able to accept NULL values, so your error shall be gone, but it depends on your application logic whether these fields are needed or optional.
0
Bernard S.CTOCommented:
When you last updated Drupal, did you run the database update it presumably needs?
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Hassan AlhusseiniAuthor Commented:
Hello Bernard

Thanks for your answer


I do not know if there was any update or not. But in all cases how can I update the database?

Thanks....
0
Hassan AlhusseiniAuthor Commented:
I found the solution

You just make the filed primary  and make it auto-increment by this

ALTER TABLE t1 MODIFY b INTEGER NOT NULL AUTO_INCREMENT;

Thank you all
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
You just make the filed primary  and make it auto-increment by this

ok, it implies that a non-null value need to be provided, as what i have mentioned earlier.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.