Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Not a Bug
-
10.6.16
-
None
-
10.6.16-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04
Description
I create a table with this definition:
create table pi_sets ( |
id bigint unsigned NOT NULL, |
date timestamp(6) NOT NULL |
default current_timestamp, |
comment varchar(800) NOT NULL |
default '', |
editor varchar(80), |
editing varchar(10) NOT NULL |
default '-', |
status varchar(10) NOT NULL |
default 'Unknown', |
PRIMARY KEY (id) |
);
|
and when I ask this question:
select COLUMN_NAME, COLUMN_DEFAULT from information_schema.columns |
where TABLE_SCHEMA = 'x' |
and TABLE_NAME = 'pi_sets' order by ORDINAL_POSITION; |
I get the ok answer:
+-------------+----------------------+
|
| COLUMN_NAME | COLUMN_DEFAULT |
|
+-------------+----------------------+
|
| id | NULL |
|
| date | current_timestamp(6) |
|
| comment | '' |
|
| editor | NULL |
|
| editing | '-' |
|
| status | 'Unknown' |
|
+-------------+----------------------+
|
But when I ask this question:
select COLUMN_NAME, isnull(COLUMN_DEFAULT) from information_schema.columns |
where TABLE_SCHEMA = 'x' |
and TABLE_NAME = 'pi_sets' order by ORDINAL_POSITION ; |
I get the strange result:
+-------------+------------------------+
|
| COLUMN_NAME | isnull(COLUMN_DEFAULT) |
|
+-------------+------------------------+
|
| id | 1 |
|
| date | 0 |
|
| comment | 0 |
|
| editor | 0 |
|
| editing | 0 |
|
| status | 0 |
|
+-------------+------------------------+
|
Shouldn't id and editor have the same value here?