radondb / radon

RadonDB is an open source, cloud-native MySQL database for building global, scalable cloud services
https://radondb.io/
GNU General Public License v3.0
1.79k stars 218 forks source link

[bug] Invalid default value for timestamp #732

Closed hustjieke closed 3 years ago

hustjieke commented 3 years ago

bug:

mysql> create table tx(a timestamp null default null, b int key);
ERROR 1067 (42000): Invalid default value for 'a'

After radon parse sql create table tx(a timestamp null default null, b int key);
and send to backends, the sql will be changed to create table tx(a timestamp default null, b int key);. For type timestamp TIMESTAMP fields are NOT NULL by default in 5.7, so we should not remove null after parse.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.