Bug #112032 | Using C program to execute query and report errors | ||
---|---|---|---|
Submitted: | 10 Aug 2023 12:57 | Modified: | 15 Aug 2023 6:34 |
Reporter: | xiang wang | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: C API (client library) | Severity: | S3 (Non-critical) |
Version: | 8.0.33 | OS: | CentOS |
Assigned to: | CPU Architecture: | Any |
[10 Aug 2023 12:57]
xiang wang
[10 Aug 2023 12:59]
xiang wang
The files used for the above tests
Attachment: tst2053.c (application/octet-stream, text), 2.54 KiB.
[10 Aug 2023 13:00]
xiang wang
The files used for the above tests
Attachment: sctyao.sql (application/octet-stream, text), 337.69 KiB.
[10 Aug 2023 13:24]
xiang wang
Question: 1. Set parameter internal_Tmp_Mem_Storage_Engine=TempTable can solve the problem of C program execution errors 2. Why do manual and C programs execute the same statements? C programs use temporary tables, while manual execution does not use temporary tables
[10 Aug 2023 13:53]
MySQL Verification Team
Hi Mr. wang, Thank you for your bug report. However, your test case using C API is incomplete. First of all, you do not use EXPLAIN at all. Second, you do not fetch nor output any results with your C program. Please, provide a C program that will show the bug. We have written our own C program with mysql_real_query() and mysql_store_result() and we have got the same EXPLAIN statement as with mysql CLI . Hence, please provide a fully repeatable test case for your program written with our C API. We are waiting for your feedback.
[14 Aug 2023 10:20]
Demon Chen
It seems that internal_tmp_disk_storage_engine affect the behavior.
[15 Aug 2023 6:16]
Demon Chen
Hi, Is there any place in document illustrate that when use mysql_stmt_* related interfaces, the result will use tmp table to store the result?
[15 Aug 2023 6:34]
xiang wang
Temporary tables were used due to the use of the CURSOR_TYPE_READ_ONLY flag. --------------------------------------------------------------------------- The character set of table sctyao is utf8mb4. When using a temporary table, even if the field is empty, the length will be calculated by 4 bytes, ultimately exceeding the limit of 8126. The manually executed Insert calculates the length of a data row based on the actual number of bytes occupied.
[16 Aug 2023 11:53]
MySQL Verification Team
Hi, You might find this page helpful: https://dev.mysql.com/doc/c-api/8.1/en/mysql-stmt-attr-set.html Try all the variants that are mentioned. Do note that this is not a bug, so please, do not post here any questions for the solutions of your problems.