summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-04-03 11:13:51 +0300
committerunknown <bell@sanja.is.com.ua>2004-04-03 11:13:51 +0300
commit8c8dffb60d23bf3a5666dcc251d2f15cb913d541 (patch)
treec9f3e9d74cc127bb1de122f2c0d31fab4719caac /tests
parenta62a5fc9c0cef8d9f1ae685b43b6dc539d6fcfc8 (diff)
downloadmariadb-git-8c8dffb60d23bf3a5666dcc251d2f15cb913d541.tar.gz
fixed brocken of client_test
fixed aggregate functions in PS (BUG#3360) mysql-test/r/union.result: 4.1 more correct error sql/item_cmpfunc.h: and_conds do not make fix fields sql/item_sum.cc: storing/restoring argument of aggregate function for prepared statements restoring order list of group_concat for safety sql/item_sum.h: storing/restoring argument of aggregate function for prepared statements layout fix sql/mysql_priv.h: just declaration sql/sql_base.cc: fix_fields() have to be called with temporary memory pool active sql/sql_parse.cc: removed hack with item pointer storing sql/sql_prepare.cc: debug output added removed hack with item pointer storing sql/sql_select.cc: fix_fields now should be called separately sql/sql_union.cc: removed wrong merged check from 4.0 (4.1 have its own protection) sql/table.h: removed hack with item pointer storing tests/client_test.c: new test fo PS
Diffstat (limited to 'tests')
-rw-r--r--tests/client_test.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/client_test.c b/tests/client_test.c
index 8cd8efdcce9..49856d6d60d 100644
--- a/tests/client_test.c
+++ b/tests/client_test.c
@@ -8531,6 +8531,52 @@ static void test_on()
}
+static void test_selecttmp()
+{
+ MYSQL_STMT *stmt;
+ int rc, i;
+ const char *query= "select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3";
+
+ myheader("test_select_tmp");
+
+ rc = mysql_query(mysql, "DROP TABLE IF EXISTS t1,t2,t3");
+ myquery(rc);
+
+ rc= mysql_query(mysql,"CREATE TABLE t1 (a int , b int);");
+ myquery(rc);
+
+ rc= mysql_query(mysql,"create table t2 (a int, b int);");
+ myquery(rc);
+
+ rc= mysql_query(mysql,"create table t3 (a int, b int);");
+ myquery(rc);
+
+ rc= mysql_query(mysql,
+ "insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), \
+(2,-1), (3,10);");
+ myquery(rc);
+ rc= mysql_query(mysql,
+ "insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1);");
+ myquery(rc);
+ rc= mysql_query(mysql,
+ "insert into t3 values (3,3), (2,2), (1,1);");
+ myquery(rc);
+
+ stmt= mysql_prepare(mysql, query, strlen(query));
+ mystmt_init(stmt);
+ for (i= 0; i < 3; i++)
+ {
+ rc= mysql_execute(stmt);
+ mystmt(stmt, rc);
+ assert(3 == my_process_stmt_result(stmt));
+ }
+ mysql_stmt_close(stmt);
+
+ rc= mysql_query(mysql, "DROP TABLE t1,t2,t3");
+ myquery(rc);
+}
+
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -8791,6 +8837,7 @@ int main(int argc, char **argv)
test_union(); /* test union with prepared statements */
test_bug3117(); /* BUG#3117: LAST_INSERT_ID() */
test_on(); /* ... join ... on(), BUG#2794 */
+ test_selecttmp(); /* temporary table used in select execution */
end_time= time((time_t *)0);