MySQL Forums
Forum List  »  Performance

Default of (var)binary column shown as hex if query this from information_schema even with --skip-binary-as-hex flag
Posted by: Stepan Furman
Date: April 02, 2020 03:57AM

Description:

Updating or product to support MySQL-8 we figured out that select returns values of varbinary columns as hex. Quick googling brought us to --skip-
binary-as-hex flag which fixed this. But when we want to check what is default value right now for varbinary column (we have a test for that) we still get hex...

Does anybody have an idea of how to preserve MySQL-5.7 backward compatible behavior?
Any other client flag? Or some configuration?


Preconditions:

Run query
CREATE TABLE `test_table` (
`smallint` smallint NOT NULL AUTO_INCREMENT,
`tinyint` tinyint DEFAULT NULL,
`varchar` varchar(254) DEFAULT NULL,
`varbinary` varbinary(255) DEFAULT 'test',
PRIMARY KEY (`smallint`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;


Steps to reproduce:

- run mysql client with flag --skip-binary-as-hex
- run query
select c.COLUMN_DEFAULT
from information_schema.COLUMNS as c
where c.TABLE_NAME like 'test_table'
and c.TABLE_SCHEMA = 'magento2'
and c.COLUMN_NAME = 'varbinary';


Expected result:

'test'


Actual result:

0x74657374

Thanks in advance for any help

Options: ReplyQuote


Subject
Views
Written By
Posted
Default of (var)binary column shown as hex if query this from information_schema even with --skip-binary-as-hex flag
961
April 02, 2020 03:57AM


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.