Several Errors creating a new table with Default Values.

chiaravel's profile image chiaravel posted 11 months ago in General Permalink

Hi,

In new versions, HeidiSQL reject all new tables by default values error.

Can check please ?

CREATE TABLE metodos_pago ( MP_Id TINYINT UNSIGNED NOT NULL AUTO_INCREMENT, MP_Descripcion VARCHAR(50) NOT NULL DEFAULT (), MP_Status TINYINT UNSIGNED NOT NULL, PRIMARY KEY (MP_Id) ) COLLATE='utf8mb3_general_ci' ; / Error de SQL (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), MP_Status TINYINT UNSIGNED NOT NULL, PRIMARY KEY (MP_Id) ) COLLATE=' at line 3 /

HeidiSQL are including a "()" in the default values.. this is wrong.

Thanks

ansgar's profile image ansgar posted 11 months ago Permalink

Which server/version is that? And which HeidiSQL build?

chiaravel's profile image chiaravel posted 11 months ago Permalink

Hi

MySQL 8.0.33 HeidiSQL 12.5.0.6677

Try with CURRENT_TIMESTAMP in ON UPDATE, or in EXPRESION and you will have a fail

I use HeidiSQL since 18 years ago, but I see now a lot of bugs in DEFAULT VALUES

Regards

chiaravel's profile image chiaravel posted 11 months ago Permalink

Description

ansgar's profile image ansgar posted 11 months ago Permalink

I added the surrounding parentheses for issue #1800. The MySQL docs say these are required since MySQL 8.0.13 (including your v8.0.33): https://dev.mysql.com/doc/refman/8.0/en/data-type-defaults.html#data-type-defaults-explicit

Is there anything special on your MySQL installation?

chiaravel's profile image chiaravel posted 11 months ago Permalink

No

I have the last MySQL Community version 8.0.33

I use Aurora MySQL with compatibility to 8.0.26 version, and this parentheces is not present

Can you check yourself with this MySQL Version ?

chiaravel's profile image chiaravel posted 11 months ago Permalink

Description

Please login to leave a reply, or register at first.