зеркало из https://github.com/github/vitess-gh.git
fix failing plan_test, add more rewriting tests for database()
Signed-off-by: deepthi <deepthi@planetscale.com>
This commit is contained in:
Родитель
3cb2f6c2e6
Коммит
6151d4ca38
|
@ -44,6 +44,11 @@ func TestRewrites(in *testing.T) {
|
|||
expected: "SELECT :__vtdbname as `database()`",
|
||||
db: true, liid: false,
|
||||
},
|
||||
{
|
||||
in: "SELECT database() from test",
|
||||
expected: "SELECT database() from test",
|
||||
db: false, liid: false,
|
||||
},
|
||||
{
|
||||
in: "SELECT last_insert_id() as test",
|
||||
expected: "SELECT :__lastInsertId as test",
|
||||
|
@ -54,6 +59,16 @@ func TestRewrites(in *testing.T) {
|
|||
expected: "SELECT :__lastInsertId + :__vtdbname as `last_insert_id() + database()`",
|
||||
db: true, liid: true,
|
||||
},
|
||||
{
|
||||
in: "select (select database()) from test",
|
||||
expected: "select (select database() from dual) from test",
|
||||
db: false, liid: false,
|
||||
},
|
||||
{
|
||||
in: "select (select database() from dual) from test",
|
||||
expected: "select (select database() from dual) from test",
|
||||
db: false, liid: false,
|
||||
},
|
||||
{
|
||||
in: "select (select database() from dual) from dual",
|
||||
expected: "select (select :__vtdbname as `database()` from dual) as `(select database() from dual)` from dual",
|
||||
|
|
|
@ -1078,7 +1078,7 @@
|
|||
"Name": "user",
|
||||
"Sharded": true
|
||||
},
|
||||
"Query": "select id from user where :__vtdbname",
|
||||
"Query": "select id from user where database()",
|
||||
"FieldQuery": "select id from user where 1 != 1",
|
||||
"Table": "user"
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче