forked from sqlancer/sqlancer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid logging CREATE TABLE exception (sqlancer#875)
* fix: avoid logging CREATE TABLE exception * Update TestLoggableFactory.java * Update SQLLoggableFactory.java We need to check the query in the constructor * Update SQLLoggableFactory.java Fix wrong indent. * fix: check couldAffectSchema before setting false * fix: revise check query string --------- Co-authored-by: Yichen Yan <[email protected]>
- Loading branch information
1 parent
33d6957
commit 9bcc3ff
Showing
2 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package sqlancer; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import sqlancer.common.log.SQLLoggableFactory; | ||
import sqlancer.common.query.SQLQueryAdapter; | ||
|
||
public class TestLoggableFactory { | ||
|
||
@Test | ||
public void testLogCreateTable() { | ||
String query = "CREATE TABLE t1 (c1 INT)"; | ||
SQLLoggableFactory logger = new SQLLoggableFactory(); | ||
SQLQueryAdapter queryAdapter = logger.getQueryForStateToReproduce(query); | ||
assert (queryAdapter.couldAffectSchema()); | ||
} | ||
|
||
} |