Skip to content

Commit

Permalink
Merge pull request #10526 from lnkuiper/null_to_json_cast
Browse files Browse the repository at this point in the history
Use null cast instead of reinterpret for NULL -> JSON
  • Loading branch information
Mytherin committed Feb 8, 2024
2 parents c64a23c + 2c7688d commit 3f4d49a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extension/json/json_functions.cpp
Expand Up @@ -248,7 +248,7 @@ void JSONFunctions::RegisterSimpleCastFunctions(CastFunctionSet &casts) {

// Register NULL to JSON with a different cost than NULL to VARCHAR so the binder can disambiguate functions
auto null_to_json_cost = casts.ImplicitCastCost(LogicalType::SQLNULL, LogicalTypeId::VARCHAR) + 1;
casts.RegisterCastFunction(LogicalType::SQLNULL, LogicalType::JSON(), DefaultCasts::ReinterpretCast,
casts.RegisterCastFunction(LogicalType::SQLNULL, LogicalType::JSON(), DefaultCasts::TryVectorNullCast,
null_to_json_cost);
}

Expand Down

0 comments on commit 3f4d49a

Please sign in to comment.