MySQL Forums
Forum List  »  General

How to determine a binary column's default value
Posted by: Michel H
Date: August 08, 2021 05:53AM

Hi everyone!

I try to determine a binary column's default value for MySQL 5.6, 5.7 and 8.0. But I just can't manage to extract them.

Example table:

CREATE TABLE `binary_test` (
`col` varbinary(100) DEFAULT X'aaaa00aaaaaaaaffffff'
) ENGINE=InnoDB;

Try 1: Getting the default from information_schema.columns doesn't work, it shows an empty string.

SELECT * FROM information_schema.columns WHERE column_name='col'

Try 2: Show create table gets closer but shows question marks.

SHOW CREATE TABLE binary_test;

Try 3: Explain also doesn't work.. (EXPLAIN binary_test)

And now I am out of ideas :)

Does anyone know how to get the binary column default value?

Options: ReplyQuote


Subject
Written By
Posted
How to determine a binary column's default value
August 08, 2021 05:53AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.