diff --git a/src/mizugaki/parser/sql_parser.yy b/src/mizugaki/parser/sql_parser.yy index da5c47d..bbc06f7 100644 --- a/src/mizugaki/parser/sql_parser.yy +++ b/src/mizugaki/parser/sql_parser.yy @@ -664,11 +664,8 @@ %token OWNED "OWNED" %token PLACING "PLACING" -%token BYTE "BYTE" -%token BYTEVAR "BYTEVAR" - %token VARBIT "VARBIT" -%token VARBYTE "VARBYTE" +%token VARBINARY "VARBINARY" %token TINYINT "TINYINT" %token BIGINT "BIGINT" @@ -3786,7 +3783,7 @@ data_type_system $s, @$); } - | BYTE[k] parenthesized_size_opt[s] + | BINARY[k] parenthesized_size_opt[s] { $$ = driver.node( regioned { ast::type::kind::octet, @k }, @@ -3949,9 +3946,8 @@ bit_varying_type_name ; octet_varying_type_name - : BYTE VARYING - | BYTEVAR - | VARBYTE + : BINARY VARYING + | VARBINARY ; decimal_type_name diff --git a/src/mizugaki/parser/sql_scanner.ll b/src/mizugaki/parser/sql_scanner.ll index c5c4591..ece5159 100644 --- a/src/mizugaki/parser/sql_scanner.ll +++ b/src/mizugaki/parser/sql_scanner.ll @@ -422,10 +422,8 @@ host_parameter_name ":"{identifier} "IF" { return parser_type::make_IF(location()); } "INDEX" { return parser_type::make_INDEX(location()); } -"BYTE" { return parser_type::make_BYTE(location()); } -"BYTEVAR" { return parser_type::make_BYTEVAR(location()); } "VARBIT" { return parser_type::make_VARBIT(location()); } -"VARBYTE" { return parser_type::make_VARBYTE(location()); } +"VARBINARY" { return parser_type::make_VARBINARY(location()); } "PLACING" { return parser_type::make_PLACING(location()); } "TINYINT" { return parser_type::make_TINYINT(location()); } diff --git a/test/mizugaki/parser/sql_parser_type_test.cpp b/test/mizugaki/parser/sql_parser_type_test.cpp index 29cafb7..8b6e7ca 100644 --- a/test/mizugaki/parser/sql_parser_type_test.cpp +++ b/test/mizugaki/parser/sql_parser_type_test.cpp @@ -155,7 +155,7 @@ TEST_F(sql_parser_type_test, bit_varying_flexible) { } TEST_F(sql_parser_type_test, octet) { - auto result = parse("BYTE"); + auto result = parse("BINARY"); ASSERT_TRUE(result) << diagnostics(result); EXPECT_EQ(extract(result), (type::octet_string { @@ -164,7 +164,7 @@ TEST_F(sql_parser_type_test, octet) { } TEST_F(sql_parser_type_test, octet_length) { - auto result = parse("BYTE(16)"); + auto result = parse("BINARY(16)"); ASSERT_TRUE(result) << diagnostics(result); EXPECT_EQ(extract(result), (type::octet_string { @@ -174,7 +174,7 @@ TEST_F(sql_parser_type_test, octet_length) { } TEST_F(sql_parser_type_test, octet_varying) { - auto result = parse("BYTE VARYING(256)"); + auto result = parse("BINARY VARYING(256)"); ASSERT_TRUE(result) << diagnostics(result); EXPECT_EQ(extract(result), (type::octet_string { @@ -184,7 +184,7 @@ TEST_F(sql_parser_type_test, octet_varying) { } TEST_F(sql_parser_type_test, octet_varying_flexible) { - auto result = parse("VARBYTE(*)"); + auto result = parse("VARBINARY(*)"); ASSERT_TRUE(result) << diagnostics(result); EXPECT_EQ(extract(result), (type::octet_string {