Add SELECT @@Version fake value '5.7.30' #11089

This commit is contained in:
BohuTANG 2020-06-24 21:32:33 +08:00
parent 6f28d7b8b5
commit 2aa92a8563
4 changed files with 10 additions and 6 deletions

View File

@ -77,7 +77,8 @@ private:
DataTypePtr type;
Field value;
};
std::unordered_map<String, TypeAndValue> global_variable_map = {{"max_allowed_packet", {std::make_shared<DataTypeInt32>(), 67108864}}};
std::unordered_map<String, TypeAndValue> global_variable_map = {
{"max_allowed_packet", {std::make_shared<DataTypeInt32>(), 67108864}}, {"version", {std::make_shared<DataTypeString>(), "5.7.30"}}};
};

View File

@ -1295,7 +1295,7 @@ bool ParserMySQLGlobalVariable::parseImpl(Pos & pos, ASTPtr & node, Expected & e
function_node->children.push_back(expr_list_args);
node = function_node;
node->setAlias(name);
node->setAlias("@@" + name);
return true;
}

View File

@ -1,13 +1,15 @@
0
"max_allowed_packet"
"@@max_allowed_packet"
67108864
"MAX_ALLOWED_PACKET"
"@@MAX_ALLOWED_PACKET"
67108864
"max_allowed_packet","number"
"@@max_allowed_packet","number"
67108864,0
67108864,1
67108864,2
"auto_increment_increment"
"@@auto_increment_increment"
0
"auto_increment_increment"
0
"@@Version"
"5.7.30"

View File

@ -4,3 +4,4 @@ SELECT @@MAX_ALLOWED_PACKET FORMAT CSVWithNames;
SELECT @@max_allowed_packet, number FROM system.numbers LIMIT 3 FORMAT CSVWithNames;
SELECT @@session.auto_increment_increment FORMAT CSVWithNames;
SELECT @@session.auto_increment_increment AS auto_increment_increment FORMAT CSVWithNames;
SELECT @@Version FORMAT CSVWithNames;