Commit 0f92333d authored by unknown's avatar unknown

Fix the test for Bug#11111: coding style, a compiler warning, don't

use tabs.

parent 16613aad
...@@ -13151,13 +13151,14 @@ static void test_bug9643() ...@@ -13151,13 +13151,14 @@ static void test_bug9643()
static void test_bug11111() static void test_bug11111()
{ {
MYSQL_STMT *stmt; MYSQL_STMT *stmt;
MYSQL_BIND bind[2]; MYSQL_BIND bind[2];
char buf[2][20]; char buf[2][20];
long len[2]; ulong len[2];
int i; int i;
int rc; int rc;
const char * query = "SELECT DISTINCT f1,ff2 FROM v1"; const char *query= "SELECT DISTINCT f1,ff2 FROM v1";
myheader("test_bug11111"); myheader("test_bug11111");
rc= mysql_query(mysql, "drop table if exists t1, t2, v1"); rc= mysql_query(mysql, "drop table if exists t1, t2, v1");
...@@ -13175,24 +13176,27 @@ static void test_bug11111() ...@@ -13175,24 +13176,27 @@ static void test_bug11111()
rc= mysql_query(mysql, "insert into t2 values (1,1), (2,2), (3,3)"); rc= mysql_query(mysql, "insert into t2 values (1,1), (2,2), (3,3)");
myquery(rc); myquery(rc);
stmt = mysql_stmt_init(mysql); stmt= mysql_stmt_init(mysql);
mysql_stmt_prepare(stmt, query, strlen(query)); mysql_stmt_prepare(stmt, query, strlen(query));
mysql_stmt_execute(stmt); mysql_stmt_execute(stmt);
for (i=0; i < 2; i++) { bzero(bind, sizeof(bind));
memset(&bind[i], '\0', sizeof(MYSQL_BIND)); for (i=0; i < 2; i++)
{
bind[i].buffer_type= MYSQL_TYPE_STRING; bind[i].buffer_type= MYSQL_TYPE_STRING;
bind[i].buffer= (gptr *)&buf[i]; bind[i].buffer= (gptr *)&buf[i];
bind[i].buffer_length= 20; bind[i].buffer_length= 20;
bind[i].length= &len[i]; bind[i].length= &len[i];
} }
if (mysql_stmt_bind_result(stmt, bind)) rc= mysql_stmt_bind_result(stmt, bind);
printf("Error: %s\n", mysql_stmt_error(stmt)); check_execute(stmt, rc);
mysql_stmt_fetch(stmt); rc= mysql_stmt_fetch(stmt);
printf("return: %s", buf[1]); check_execute(stmt, rc);
if (!opt_silent)
printf("return: %s", buf[1]);
DIE_UNLESS(!strcmp(buf[1],"1")); DIE_UNLESS(!strcmp(buf[1],"1"));
mysql_stmt_close(stmt); mysql_stmt_close(stmt);
rc= mysql_query(mysql, "drop view v1"); rc= mysql_query(mysql, "drop view v1");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment