Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Generated column missing and then not listed as virtual

caram's profile image caram posted 1 month ago in General Permalink

I run the following query:

alter table T add columnis_somethingTINYINT(1) generated always as (is_not_something = 0) virtual

two things happen:

  1. the field is not immediately visible in the table editor or in the </> Code CREATE. I have to restart HeidiSQL for it to appear;
  2. upon restart, the field becomes visible, but is not listed as virtual. I.e. the Virtual column is blank. But I have confirmed that it is indeed computed at runtime by the MySQL database

MySQL version 8.0.21

caram's profile image caram posted 1 month ago Permalink

Two other related issues:

  1. There is an error when I try to move a VIRTUAL column in the table definition view. HeidiSQL says it cannot redefine STORED columns.

  2. I could not find a way to view the expression of a VIRTUAL column after it has been created, except by using the following expression. Am I missing something?

SELECT column_name, generation_expression
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'T';

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




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.