MySQL Forums
Forum List  »  NDB clusters

Re: SQLSTATE[HY000]: General error: 1296 Got error 839 'Illegal null attribute' from NDBCLUSTER [updated]
Posted by: Sucre Sucre
Date: May 30, 2022 08:15PM

I tried but bug database in maintenance.

Got error 839 when insert into table after alter it with a tinyint field's default value added: default '0'; it has no default value set before that.

How to repeat:
First create a table with a field setting:
`the_field` tinyint NOT NULL

Then alter the table change that field's setting to:
CHANGE the_field the_field tinyint NOT NULL DEFAULT '0';
CHANGE the_field the_field tinyint NOT NULL DEFAULT 0;(or)

Then do a simple insert statement like below you'll get the error message.
insert into mytable(another_field) value('somevalue');

Suggest fix:

My workaroud:
deleted the table and recreated with the DEFAULT VALUE setting set in the create table statement.


Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.