344 lines
11 KiB
JSON
344 lines
11 KiB
JSON
[
|
|
{
|
|
"name": "TestPlanCacheWithDifferentVariableTypes",
|
|
"cases": [
|
|
{
|
|
"PrepareStmt": "prepare stmt from \"select ?, ?\"",
|
|
"Executes": [
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "1"}, {"Name": "v2", "Value": "2"}],
|
|
"ExecuteSQL": "execute stmt using @v1, @v2"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "1"}, {"Name": "v2", "Value": "\"abc\""}],
|
|
"ExecuteSQL": "execute stmt using @v1, @v2"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "10"}, {"Name": "v2", "Value": "\"cba\""}],
|
|
"ExecuteSQL": "execute stmt using @v1, @v2"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"PrepareStmt": "prepare stmt from \"select a from t1 where t1.b = ?\"",
|
|
"Executes": [
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "3"}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "2"}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "-200"}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"abc\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"PrepareStmt": "prepare stmt from \"select t1.c, t2.c from t1 join t2 on t1.b = t2.b and t1.a = t2.a where t1.b = ?\"",
|
|
"Executes": [
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "1"}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "2"}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"abc\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"PrepareStmt": "prepare stmt from \"select cast(? as decimal)\"",
|
|
"Executes": [
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"123456789.0123456789012345678901234567890123456789\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"1234567.1234567\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"0.99999\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"99999.0\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-123456789.0123456789012345678901234567890123456789\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-1234567.1234567\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-0.99999\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-99999.0\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"PrepareStmt": "prepare stmt from \"select cast(? as decimal(10,0))\"",
|
|
"Executes": [
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"123456789.0123456789012345678901234567890123456789\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"1234567.1234567\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"0.99999\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"99999.0\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-123456789.0123456789012345678901234567890123456789\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-1234567.1234567\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-0.99999\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-99999.0\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"PrepareStmt": "prepare stmt from \"select cast(? as decimal(5,4))\"",
|
|
"Executes": [
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"123456789.0123456789012345678901234567890123456789\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"1234567.1234567\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"0.99999\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"99999.0\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-123456789.0123456789012345678901234567890123456789\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-1234567.1234567\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-0.99999\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-99999.0\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"PrepareStmt": "prepare stmt from \"select cast(? as decimal(64, 30))\"",
|
|
"Executes": [
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"123456789.0123456789012345678901234567890123456789\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"1234567.1234567\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"0.99999\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"99999.0\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-123456789.0123456789012345678901234567890123456789\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-1234567.1234567\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-0.99999\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-99999.0\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"PrepareStmt": "prepare stmt from \"select cast(? as decimal(15,5))\"",
|
|
"Executes": [
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"123456789.0123456789012345678901234567890123456789\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"1234567.1234567\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"0.99999\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"99999.0\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-123456789.0123456789012345678901234567890123456789\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-1234567.1234567\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-0.99999\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-99999.0\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"PrepareStmt": "prepare stmt from \"select cast(? as decimal(5,5))\"",
|
|
"Executes": [
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"123456789.0123456789012345678901234567890123456789\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"1234567.1234567\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"0.99999\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"99999.0\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-123456789.0123456789012345678901234567890123456789\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-1234567.1234567\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-0.99999\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
},
|
|
{
|
|
"Vars": [{"Name": "v1", "Value": "\"-99999.0\""}],
|
|
"ExecuteSQL": "execute stmt using @v1"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "TestParameterPushDown",
|
|
"cases": [
|
|
{
|
|
"SQL": "prepare s1 from 'select a from t use index(a) where a+0>?'; -- IndexReader + pushed-down Selection with parameters"
|
|
},
|
|
{
|
|
"SQL": "execute s1 using @x1"
|
|
},
|
|
{
|
|
"SQL": "execute s1 using @x5"
|
|
},
|
|
{
|
|
"SQL": "prepare s1 from 'select * from t where b>?'; -- TableReader + pushed-down Selection with parameters"
|
|
},
|
|
{
|
|
"SQL": "execute s1 using @x1"
|
|
},
|
|
{
|
|
"SQL": "execute s1 using @x5"
|
|
},
|
|
{
|
|
"SQL": "prepare s1 from 'select * from t use index(a) where a+0>? and b>?'; -- IndexLookup + pushed-down Selection with parameters"
|
|
},
|
|
{
|
|
"SQL": "execute s1 using @x1,@x1"
|
|
},
|
|
{
|
|
"SQL": "execute s1 using @x5,@x5"
|
|
},
|
|
{
|
|
"SQL": "prepare s1 from 'select * from t limit ?'; -- pushed-down Limit with parameters"
|
|
},
|
|
{
|
|
"SQL": "execute s1 using @x10"
|
|
},
|
|
{
|
|
"SQL": "execute s1 using @x20"
|
|
},
|
|
{
|
|
"SQL": "prepare s1 from 'select * from t order by b limit ?'; -- pushed-down TopN with parameters"
|
|
},
|
|
{
|
|
"SQL": "execute s1 using @x1"
|
|
},
|
|
{
|
|
"SQL": "execute s1 using @x5"
|
|
},
|
|
{
|
|
"SQL": "prepare s1 from 'select b, sum(c+?) from t group by b'; -- pushed-down Agg with parameters"
|
|
},
|
|
{
|
|
"SQL": "execute s1 using @x1"
|
|
},
|
|
{
|
|
"SQL": "execute s1 using @x5"
|
|
}
|
|
]
|
|
}
|
|
]
|