Skip to content
  • Guilhem Bichot's avatar
    d19bad62
    WL#13068 Deprecate BINARY keyword for specifying _bin collations · d19bad62
    Guilhem Bichot authored
    Any use of the BINARY keyword in a query when (and only when) the goal
    is to specify a _bin collation of a character set, now triggers a
    warning like this:
    'BINARY as attribute of a type' is deprecated and will be removed in a future
    release. Please use a CHARACTER SET clause with _bin collation instead
    
    Examples:
    create table t1 (v varchar(10) binary);
    create table t1 (v varchar(10) character set latin1 binary);
    create table t1 (v varchar(10) binary ascii);
    select cast('a' as char(2) binary);
    All above statements now send a warning.
    But the ones below still don't, as they do select a
    "binary" *charset*, not just a "_bin" collation of another charset
    
    create table t1 (v binary(10));
    create table t1 (v varchar(10)) character set binary;
    alter table t1 character set binary;
    create database mysqltest2 default character set = binary;
    set names binary;
    select convert("123" using binary);
    
    Approved by Gleb Shchepa <gleb.shchepa@oracle.com>
    d19bad62
    WL#13068 Deprecate BINARY keyword for specifying _bin collations
    Guilhem Bichot authored
    Any use of the BINARY keyword in a query when (and only when) the goal
    is to specify a _bin collation of a character set, now triggers a
    warning like this:
    'BINARY as attribute of a type' is deprecated and will be removed in a future
    release. Please use a CHARACTER SET clause with _bin collation instead
    
    Examples:
    create table t1 (v varchar(10) binary);
    create table t1 (v varchar(10) character set latin1 binary);
    create table t1 (v varchar(10) binary ascii);
    select cast('a' as char(2) binary);
    All above statements now send a warning.
    But the ones below still don't, as they do select a
    "binary" *charset*, not just a "_bin" collation of another charset
    
    create table t1 (v binary(10));
    create table t1 (v varchar(10)) character set binary;
    alter table t1 character set binary;
    create database mysqltest2 default character set = binary;
    set names binary;
    select convert("123" using binary);
    
    Approved by Gleb Shchepa <gleb.shchepa@oracle.com>
Loading