Add Support for Merge Generator in Postgres v15 by yaojiejia · Pull Request #1255 · sqlancer/sqlancer
-
Notifications
You must be signed in to change notification settings - Fork 400
Conversation
|
|
||
| PostgresColumn column = columns.get(i); | ||
|
|
||
| if (Randomly.getBoolean() && sourceHasColumn(column, sourceTable)) { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of repeated code patterns here. It would be great to factor them out to methods.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep!
| } else { | ||
| sb.append(generateUpdateSet(targetTable, sourceTable)); | ||
| } | ||
| } catch (Exception e) { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a bit surprising. Why does throwing an exception affect the logic of what we generate here? Can we achieve the intended outcome without relying on exceptions?
This file contains hidden or 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