-
Notifications
You must be signed in to change notification settings - Fork 5k
fix: stmt2 query block #33864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: stmt2 query block #33864
Conversation
Summary of ChangesHello @Pengrongkun, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a bug in the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request appears to fix an issue with prepared statement queries, particularly for information_schema tables, by enhancing how placeholder values are handled in the parser. The changes in parUtil.c seem robust and correctly manage different data types and memory for placeholders. The logging levels in clientStmt2.c have been adjusted, which is a reasonable change. However, I've identified a couple of issues in the new test case in stmt2Test.cpp that should be addressed.
| // int code = taos_stmt2_prepare(stmt, "select tbname,t2,b from stmt2_testdb_7.stb where ts = ? and tbname = ?", 0); | ||
| // checkError(stmt, code); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| code = taos_stmt2_get_fields(stmt, &fieldNum, &pFields); | ||
| checkError(stmt, code); | ||
| ASSERT_EQ(fieldNum, 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assertion ASSERT_EQ(fieldNum, 2) is confusing. The function taos_stmt2_get_fields is expected to return the number of result columns, which is 3 for the query select table_name, db_name, stable_name .... The number of parameters for this query is 2.
If taos_stmt2_get_fields is intended to get the parameter count for SELECT queries, its name is misleading. If it's meant to get result fields, the assertion is incorrect. Please clarify the function's behavior for SELECT statements or correct the test. If you intended to get the number of parameters, a function like taos_stmt2_get_param_num should be used if available.
Description
https://project.feishu.cn/taosdata_td/defect/detail/6506118573
Issue(s)
Checklist
Please check the items in the checklist if applicable.