← 输入框|github.com|刷新
Skip to content

Add query logging for MySQL - #793

Closed
arvind-murty wants to merge 1 commit into
sqlancer:masterfrom
arvind-murty:am-mysql-log
Closed

arvind-murty wants to merge 1 commit into
sqlancer:masterfrom
arvind-murty:am-mysql-log

Conversation

@arvind-murty

@arvind-murty arvind-murty commented May 24, 2023 •

Copy link
Copy Markdown

This PR adds query logging for MySQL. I simply copied from SQLite3TLPWhereOracle.java, as modified by PR #648.

Signed-off-by: Arvind Murty <arvindmurty@arvinds-mbp.lan>
@arvind-murty

Copy link
Copy Markdown
Author

This does not actually fix anything. The log files are overwritten when an erroring query occurs (which I assume is intended behavior), and MySQL errors far more frequently than other DBMS's.

@arvind-murty
arvind-murty deleted the am-mysql-log branch May 24, 2023 08:15
@mrigger

mrigger commented May 25, 2023

Copy link
Copy Markdown
Contributor

MySQL errors far more frequently than other DBMS's

During normal execution, no errors should appear unless SQLancer has found a bug. Perhaps it is related to https://github.com/sqlancer/sqlancer#i-am-running-sqlancer-on-the-latest-version-of-a-supported-dbms-is-it-expected-that-sqlancer-prints-many-assertionerrors?

@arvind-murty

Copy link
Copy Markdown
Author

MySQL errors far more frequently than other DBMS's

During normal execution, no errors should appear unless SQLancer has found a bug. Perhaps it is related to https://github.com/sqlancer/sqlancer#i-am-running-sqlancer-on-the-latest-version-of-a-supported-dbms-is-it-expected-that-sqlancer-prints-many-assertionerrors?

Yes, most likely, since I am running MySQL 8.0.33.

I was also thinking about the logging behavior and I'm not sure if it's intended anymore. Essentially, if I exit the execution (with --num-tries set to 1) before an AssertionError is thrown, there is only one log file produced (database0-cur.log), which has all of the successfully executed queries.

If instead an AssertionError is thrown, then there are two log files produced (database0-cur.log and database0.log), both of which only have the unsuccessful query.

I only found this behavior on MySQL because the other DBMS's I tested (DuckDB and SQLite) never errored, which is why I thought MySQL had a logging error.

@mrigger

mrigger commented May 25, 2023

Copy link
Copy Markdown
Contributor

Yes, that sounds like a bug. Thanks for mentioning it! Do you want to open an issue copying the text? If not, I can create an issue. We should also at some point in time update the MySQL implementation (cc @Zhenglin-Li and @bajinsheng).

@arvind-murty

Copy link
Copy Markdown
Author

Yes, that sounds like a bug. Thanks for mentioning it! Do you want to open an issue copying the text?

I have created the issue (#794).

@zhenglin-charlie-li

Copy link
Copy Markdown
Contributor

Yes, that sounds like a bug. Thanks for mentioning it! Do you want to open an issue copying the text?

I have created the issue (#794).

ok, will have a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants