mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Don't create Object type if use_json_alias_for_old_object_type=1 but allow_experimental_object_type=0
This commit is contained in:
parent
a7d0a5991e
commit
457db103c0
@ -519,7 +519,7 @@ static DataTypePtr createJSON(const ASTPtr & arguments)
|
||||
if (!context)
|
||||
context = Context::getGlobalContextInstance();
|
||||
|
||||
if (context->getSettingsRef().use_json_alias_for_old_object_type)
|
||||
if (context->getSettingsRef().allow_experimental_object_type && context->getSettingsRef().use_json_alias_for_old_object_type)
|
||||
{
|
||||
if (arguments && !arguments->children.empty())
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Experimental Object type doesn't support any arguments. If you want to use new JSON type, set setting allow_experimental_json_type = 1");
|
||||
|
@ -1,2 +1,3 @@
|
||||
{"a":"42"} JSON
|
||||
{"a":42} Object(\'json\')
|
||||
{"a":"42"} JSON
|
||||
|
@ -6,3 +6,6 @@ set use_json_alias_for_old_object_type=1;
|
||||
select '{"a" : 42}'::JSON as json, toTypeName(json);
|
||||
select '{"a" : 42}'::JSON(max_dynamic_paths=100) as json, toTypeName(json); -- {serverError BAD_ARGUMENTS}
|
||||
|
||||
set allow_experimental_object_type = 0;
|
||||
select materialize('{"a" : 42}')::JSON as json, toTypeName(json);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user