static void test_view_sp_list_fields ( ) {
 int rc ;
 MYSQL_RES * res ;
 myheader ( "test_view_sp_list_fields" ) ;
 rc = mysql_query ( mysql , "DROP FUNCTION IF EXISTS f1" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "DROP TABLE IF EXISTS v1, t1, t2" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "DROP VIEW IF EXISTS v1, t1, t2" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "create function f1 () returns int return 5" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "create table t1 (s1 char,s2 char)" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "create table t2 (s1 int);
" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "create view v1 as select s2,sum(s1) - \ count(s2) as vx from t1 group by s2 having sum(s1) - count(s2) < (select f1() \ from t2);
" ) ;
 myquery ( rc ) ;
 res = mysql_list_fields ( mysql , "v1" , NullS ) ;
 DIE_UNLESS ( res != 0 && mysql_num_fields ( res ) != 0 ) ;
 rc = mysql_query ( mysql , "DROP FUNCTION f1" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "DROP VIEW v1" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "DROP TABLE t1, t2" ) ;
 mysql_free_result ( res ) ;
 myquery ( rc ) ;
 }
static void test_view_sp_list_fields ( ) {
 int rc ;
 MYSQL_RES * res ;
 myheader ( "test_view_sp_list_fields" ) ;
 rc = mysql_query ( mysql , "DROP FUNCTION IF EXISTS f1" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "DROP TABLE IF EXISTS v1, t1, t2" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "DROP VIEW IF EXISTS v1, t1, t2" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "create function f1 () returns int return 5" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "create table t1 (s1 char,s2 char)" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "create table t2 (s1 int);
" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "create view v1 as select s2,sum(s1) - \ count(s2) as vx from t1 group by s2 having sum(s1) - count(s2) < (select f1() \ from t2);
" ) ;
 myquery ( rc ) ;
 res = mysql_list_fields ( mysql , "v1" , NullS ) ;
 DIE_UNLESS ( res != 0 && mysql_num_fields ( res ) != 0 ) ;
 rc = mysql_query ( mysql , "DROP FUNCTION f1" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "DROP VIEW v1" ) ;
 myquery ( rc ) ;
 rc = mysql_query ( mysql , "DROP TABLE t1, t2" ) ;
 mysql_free_result ( res ) ;
 myquery ( rc ) ;
 }