Hi Davi!
On 07.09.2010, at 2:35, Davi Arnaut wrote:
>>
>> === modified file 'libmysql/libmysql.c'
>> --- a/libmysql/libmysql.c 2010-07-06 22:31:54 +0000
>> +++ b/libmysql/libmysql.c 2010-07-29 10:59:33 +0000
>> @@ -2502,7 +2502,8 @@ static my_bool execute(MYSQL_STMT *stmt,
>> if (stmt->mysql)
>> set_stmt_errmsg(stmt, net);
>> DBUG_RETURN(1);
>> - }
>> + } else if (mysql->status == MYSQL_STATUS_GET_RESULT)
>
> Coding style, "else" should be on a new line.
>
Fixed.
>> +/**
>> + Bug#47485: mysql_store_result returns a result set for a prepared statement
>> +*/
>> +static void test_bug47485()
>> +{
>> +
>> + MYSQL_STMT *stmt_1;
>
> Simply stmt? there is no _2.
>
Fixed.
>> + MYSQL_RES *res;
>> + MYSQL_BIND bind[2];
>> + int rc;
>> + const char* sql_select = "SELECT 1, 'a'";
>
> const char sql_select[]= "SELECT 1, 'a'";
Left as is since const char* is better type for a character literal. const char * points
to some data allocated in data segment whereas const char[] array will be initialized
every time when function called.
So const char* is better way to declare character literal from the point of cpu perfomance
and memory usage.
>
>> + rc= mysql_stmt_execute(stmt_1);
>> + check_execute(stmt_1, rc);
>> +
>> + rc= mysql_stmt_store_result(stmt_1);
>> + check_execute(stmt_1, rc);
>> +
>> + while (!(rc= mysql_stmt_fetch(stmt_1)));
>
> Put the semicolon on a new line.
Fixed.
>
> Regards,
>
> Davi
Regards,
Dmitry.