mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-05 21:02:58 +00:00
fix: ident value in set search_path (#6153)
* fix: ident value in set search_path * refactor: remove unneeded clone
This commit is contained in:
@@ -122,7 +122,11 @@ pub fn set_search_path(exprs: Vec<Expr>, ctx: QueryContextRef) -> Result<()> {
|
||||
match search_expr {
|
||||
Expr::Value(Value::SingleQuotedString(search_path))
|
||||
| Expr::Value(Value::DoubleQuotedString(search_path)) => {
|
||||
ctx.set_current_schema(&search_path.clone());
|
||||
ctx.set_current_schema(search_path);
|
||||
Ok(())
|
||||
}
|
||||
Expr::Identifier(Ident { value, .. }) => {
|
||||
ctx.set_current_schema(value);
|
||||
Ok(())
|
||||
}
|
||||
expr => NotSupportedSnafu {
|
||||
|
||||
@@ -52,6 +52,11 @@ set search_path to 'public';
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
-- SQLNESS PROTOCOL POSTGRES
|
||||
set search_path = public;
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
-- SQLNESS PROTOCOL POSTGRES
|
||||
select current_schema();
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ set search_path to 'test';
|
||||
drop database test;
|
||||
-- SQLNESS PROTOCOL POSTGRES
|
||||
set search_path to 'public';
|
||||
-- SQLNESS PROTOCOL POSTGRES
|
||||
set search_path = public;
|
||||
|
||||
-- SQLNESS PROTOCOL POSTGRES
|
||||
select current_schema();
|
||||
|
||||
Reference in New Issue
Block a user