Revert "Merge pull request #36337 from ClickHouse/revert-36126-fork_chmaster2"

This reverts commit e04f80d4a7, reversing
changes made to 06e0afb67f.
This commit is contained in:
Anton Popov 2022-04-18 17:59:46 +00:00
parent dd2e085ae5
commit 56bdc654d4
3 changed files with 30 additions and 1 deletions

View File

@ -92,11 +92,26 @@ bool ParserDataType::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
}
else if (type_name_upper.find("INT") != std::string::npos)
{
/// Support SIGNED and UNSIGNED integer type modifiers for compatibility with MySQL.
/// Support SIGNED and UNSIGNED integer type modifiers for compatibility with MySQL
if (ParserKeyword("SIGNED").ignore(pos))
type_name_suffix = "SIGNED";
else if (ParserKeyword("UNSIGNED").ignore(pos))
type_name_suffix = "UNSIGNED";
else if (pos->type == TokenType::OpeningRoundBracket)
{
++pos;
if (pos->type != TokenType::Number)
return false;
++pos;
if (pos->type != TokenType::ClosingRoundBracket)
return false;
++pos;
if (ParserKeyword("SIGNED").ignore(pos))
type_name_suffix = "SIGNED";
else if (ParserKeyword("UNSIGNED").ignore(pos))
type_name_suffix = "UNSIGNED";
}
}
if (!type_name_suffix.empty())

View File

@ -1 +1,5 @@
1
CREATE TEMPORARY TABLE t3_00841\n(\n `x` UInt32\n)\nENGINE = Memory
1
CREATE TEMPORARY TABLE t4_00841\n(\n `x` Int32\n)\nENGINE = Memory
1

View File

@ -3,3 +3,13 @@ INSERT INTO t1_00841 VALUES (1);
SELECT * FROM t1_00841;
CREATE TEMPORARY TABLE test.t2_00841 (x UInt8); -- { serverError 442 }
CREATE TEMPORARY TABLE t3_00841 (x INT(11) UNSIGNED);
SHOW CREATE TEMPORARY TABLE t3_00841;
INSERT INTO t3_00841 VALUES (1);
SELECT * FROM t3_00841;
CREATE TEMPORARY TABLE t4_00841 (x INT(11) SIGNED);
SHOW CREATE TEMPORARY TABLE t4_00841;
INSERT INTO t4_00841 VALUES (1);
SELECT * FROM t4_00841;