C API Prepared Statement Problems
2228
if (result)
{
/* yes; process rows and free the result set */
process_result_set(mysql, result);
mysql_free_result(result);
}
else /* no result set or error */
{
if (mysql_field_count(mysql) == 0)
{
printf("%lld rows affected\n",
mysql_affected_rows(mysql));
}
else /* some error occurred */
{
printf("Could not retrieve result set\n");
break;
}
}
/* more results? -1 = no, >0 = error, 0 = yes (keep looping) */
if ((status = mysql_next_result(mysql)) > 0)
printf("Could not execute statement\n");
} while (status == 0);
mysql_close(mysql);
20.6.16. C API Prepared Statement Problems
Here follows a list of the currently known problems with prepared statements:
•
TIME
,
TIMESTAMP
, and
DATETIME
do not support parts of seconds (for example, from
DATE_FORMAT()
[921]
).
• When converting an integer to string,
ZEROFILL
is honored with prepared statements in some
cases where the MySQL server doesn't print the leading zeros. (For example, with
MIN(number-
with-zerofill)
[971]
).
• When converting a floating-point number to a string in the client, the rightmost digits of the converted
value may differ slightly from those of the original value.
• Prepared statements do not use the query cache, even in cases where a query does not contain any
placeholders. See
Section 8.6.3.1, “How the Query Cache Operates”
.
• Prepared statements do not support multi-statements (that is, multiple statements within a single
string separated by “
;
” characters).
• In MySQL 5.0, prepared
CALL
statements cannot invoke stored procedures that return result sets
because prepared statements do not support multiple result sets. Nor can the calling application
access a stored procedure's
OUT
or
INOUT
parameters when the procedure returns. These
capabilities are supported beginning with MySQL 5.5.
20.6.17. C API Prepared Statement Handling of Date and Time Values
The binary (prepared statement) protocol enables you to send and receive date and time values (
DATE
,
TIME
,
DATETIME
, and
TIMESTAMP
), using the
MYSQL_TIME
structure. The members of this structure
are described in
Section 20.6.8, “C API Prepared Statement Data Structures”
.
To send temporal data values, create a prepared statement using
mysql_stmt_prepare()
. Then,
before calling
mysql_stmt_execute()
to execute the statement, use the following procedure to set
up each temporal parameter:
1. In the
MYSQL_BIND
structure associated with the data value, set the
buffer_type
member to
the type that indicates what kind of temporal value you're sending. For
DATE
,
TIME
,
DATETIME
,
or
TIMESTAMP
values, set
buffer_type
to
MYSQL_TYPE_DATE
,
MYSQL_TYPE_TIME
,
MYSQL_TYPE_DATETIME
, or
MYSQL_TYPE_TIMESTAMP
, respectively.
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...