mariadb ADD COLUMN virtual = You have an error in your SQL syntax

vodish's profile image vodish posted 3 years ago in General Permalink

Pls, check create sql query?

ps. screenshot is in attach

1 attachment(s):
  • image-51-
ansgar's profile image ansgar posted 3 years ago Permalink

So when you change the default value from NULL to let's say "No default", you get no error?

vodish's profile image vodish posted 3 years ago Permalink

yes and when i create and change field from heidiSql

  1. HeidiSql is generate folow sql with error ALTER TABLE good ADD COLUMN attr_prop_int INT DEFAULT NULL AS (json_value(attr,'$.prop_int')) VIRTUAL AFTER attr;

  2. I remove the expression "DEFAULT NULL" from sql and the query works well ALTER TABLE good ADD COLUMN attr_prop_int INT AS (json_value(attr,'$.prop_int')) VIRTUAL AFTER attr;

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