Disable table function view in expression

This commit is contained in:
Amos Bird 2021-02-12 10:22:18 +08:00
parent 8ff458a2bf
commit 69d4120982
No known key found for this signature in database
GPG Key ID: 80D430DCBECFEDB4
3 changed files with 9 additions and 0 deletions

View File

@ -15,8 +15,16 @@
namespace DB
{
namespace ErrorCodes
{
extern const int UNEXPECTED_EXPRESSION;
}
void ASTFunction::appendColumnNameImpl(WriteBuffer & ostr) const
{
if (name == "view")
throw Exception("Table function view cannot be used as an expression", ErrorCodes::UNEXPECTED_EXPRESSION);
writeString(name, ostr);
if (parameters)

View File

@ -0,0 +1 @@
SELECT view(SELECT 1); -- { serverError 183 }