Content-Length: 298072 | pFad | http://github.com/sqlancer/sqlancer/commit/ec6f8a799f7e4778811dfa275f43e8ea3a849835

F1 Add support for alter column drop expression · sqlancer/sqlancer@ec6f8a7 · GitHub
Skip to content

Commit ec6f8a7

Browse files
committed
Add support for alter column drop expression
1 parent 3d9a5cc commit ec6f8a7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/sqlancer/postgres/gen/PostgresAlterTableGenerator.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ protected enum Action {
3434
ALTER_COLUMN_SET_ATTRIBUTE_OPTION, // ALTER [ COLUMN ] column SET ( attribute_option = value [, ... ] )
3535
ALTER_COLUMN_RESET_ATTRIBUTE_OPTION, // ALTER [ COLUMN ] column RESET ( attribute_option [, ... ] )
3636
ALTER_COLUMN_SET_STORAGE, // ALTER [ COLUMN ] column SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN }
37+
ALTER_COLUMN_DROP_EXPRESSION, // ALTER [ COLUMN ] column DROP EXPRESSION [ IF EXISTS ]
3738
ADD_TABLE_CONSTRAINT, // ADD table_constraint [ NOT VALID ]
3839
ADD_TABLE_CONSTRAINT_USING_INDEX, // ADD table_constraint_using_index
3940
VALIDATE_CONSTRAINT, // VALIDATE CONSTRAINT constraint_name
@@ -250,6 +251,19 @@ public SQLQueryAdapter generate() {
250251
errors.add("can only have storage");
251252
errors.add("is an identity column");
252253
break;
254+
case ALTER_COLUMN_DROP_EXPRESSION:
255+
alterColumn(randomTable, sb);
256+
sb.append("DROP EXPRESSION");
257+
if (Randomly.getBoolean()) {
258+
sb.append(" IF EXISTS");
259+
}
260+
errors.add("is not a generated column");
261+
errors.add("is not a stored generated column");
262+
errors.add("cannot drop expression from inherited column");
263+
errors.add("cannot drop generation expression from inherited column");
264+
errors.add("must be applied to child tables too");
265+
errors.add("cannot drop expression from column");
266+
break;
253267
case ADD_TABLE_CONSTRAINT:
254268
sb.append("ADD ");
255269
sb.append("CONSTRAINT " + r.getAlphabeticChar() + " ");

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/sqlancer/sqlancer/commit/ec6f8a799f7e4778811dfa275f43e8ea3a849835

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy