Merge lp:~tjoneslo/akiban-sql-parser/fix-bug-1167451 into lp:~akiban-technologies/akiban-sql-parser/trunk

Proposed by Thomas Jones-Low
Status: Merged
Approved by: Nathan Williams
Approved revision: 297
Merged at revision: 296
Proposed branch: lp:~tjoneslo/akiban-sql-parser/fix-bug-1167451
Merge into: lp:~akiban-technologies/akiban-sql-parser/trunk
Diff against target: 112 lines (+17/-5)
6 files modified
pom.xml (+1/-1)
src/main/java/com/akiban/sql/parser/DropSequenceNode.java (+11/-3)
src/main/java/com/akiban/sql/parser/IndexDefinition.java (+2/-1)
src/main/javacc/SQLGrammar.jj (+1/-0)
src/test/resources/com/akiban/sql/parser/drop-sequence-1.expected (+1/-0)
src/test/resources/com/akiban/sql/parser/drop-sequence-2.expected (+1/-0)
To merge this branch: bzr merge lp:~tjoneslo/akiban-sql-parser/fix-bug-1167451
Reviewer Review Type Date Requested Status
Thomas Jones-Low Needs Resubmitting
Akiban Build User Needs Fixing
Nathan Williams Approve
Review via email: mp+159426@code.launchpad.net

Description of the change

Fix bug 1167451 - Update the DropSequence node to include the dropBehavior (RESTRICT, CASCADE, DEFAULT) of the other DDL drop nodes. This is currently fixed at RESTRICT. Not really required, but adds flexibility for the future.

To post a comment you must log in.
Revision history for this message
Nathan Williams (nwilliams) wrote :

As described.

review: Approve
Revision history for this message
Akiban Build User (build-akiban) wrote :

There were 2 failures during build/test:

* job sql-parser-build failed at build number 290: http://172.16.20.104:8080/job/sql-parser-build/290/

* view must-pass failed: sql-parser-build is red

review: Needs Fixing
Revision history for this message
Thomas Jones-Low (tjoneslo) wrote :

Build failed on one file having a 2013 year in the header. Update the pom file check to allow this.

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'pom.xml'
--- pom.xml 2013-03-23 17:43:48 +0000
+++ pom.xml 2013-04-17 18:33:28 +0000
@@ -154,7 +154,7 @@
154 <headerSection>154 <headerSection>
155 <key>__YEAR_SECTION__</key>155 <key>__YEAR_SECTION__</key>
156 <defaultValue>2012</defaultValue>156 <defaultValue>2012</defaultValue>
157 <ensureMatch>20(11)\-2012|2012</ensureMatch>157 <ensureMatch>20(11)\-2012|2012|2013</ensureMatch>
158 </headerSection>158 </headerSection>
159 </headerSections>159 </headerSections>
160 <strictCheck>true</strictCheck>160 <strictCheck>true</strictCheck>
161161
=== modified file 'src/main/java/com/akiban/sql/parser/DropSequenceNode.java'
--- src/main/java/com/akiban/sql/parser/DropSequenceNode.java 2012-11-07 17:49:31 +0000
+++ src/main/java/com/akiban/sql/parser/DropSequenceNode.java 2013-04-17 18:33:28 +0000
@@ -50,19 +50,24 @@
50{50{
51 private TableName dropItem;51 private TableName dropItem;
52 private ExistenceCheck existenceCheck;52 private ExistenceCheck existenceCheck;
53 53 private int dropBehavior;
54 /**54 /**
55 * Initializer for a DropSequenceNode55 * Initializer for a DropSequenceNode
56 *56 *
57 * @param dropSequenceName The name of the sequence being dropped57 * @param dropSequenceName The name of the sequence being dropped
58 * @throws StandardException58 * @throws StandardException
59 */59 */
60 public void init(Object dropSequenceName, Object ec) throws StandardException {60 public void init(Object dropSequenceName, Object dropBehavior, Object ec) throws StandardException {
61 dropItem = (TableName)dropSequenceName;61 dropItem = (TableName)dropSequenceName;
62 initAndCheck(dropItem);62 initAndCheck(dropItem);
63 this.dropBehavior = ((Integer)dropBehavior).intValue();
63 this.existenceCheck = (ExistenceCheck)ec;64 this.existenceCheck = (ExistenceCheck)ec;
64 }65 }
6566
67 public int getDropBehavior() {
68 return dropBehavior;
69 }
70
66 public ExistenceCheck getExistenceCheck()71 public ExistenceCheck getExistenceCheck()
67 {72 {
68 return existenceCheck;73 return existenceCheck;
@@ -75,6 +80,8 @@
75 super.copyFrom(node);80 super.copyFrom(node);
7681
77 DropSequenceNode other = (DropSequenceNode)node;82 DropSequenceNode other = (DropSequenceNode)node;
83 this.dropBehavior = other.dropBehavior;
84 this.existenceCheck = other.existenceCheck;
78 this.dropItem = (TableName)getNodeFactory().copyNode(other.dropItem,85 this.dropItem = (TableName)getNodeFactory().copyNode(other.dropItem,
79 getParserContext());86 getParserContext());
80 }87 }
@@ -85,6 +92,7 @@
8592
86 public String toString() {93 public String toString() {
87 return super.toString() + 94 return super.toString() +
88 "existenceCheck: " + existenceCheck + "\n";95 "dropBehavior: " + dropBehavior + "\n"
96 + "existenceCheck: " + existenceCheck + "\n";
89 }97 }
90}98}
9199
=== modified file 'src/main/java/com/akiban/sql/parser/IndexDefinition.java'
--- src/main/java/com/akiban/sql/parser/IndexDefinition.java 2013-03-06 11:08:05 +0000
+++ src/main/java/com/akiban/sql/parser/IndexDefinition.java 2013-04-17 18:33:28 +0000
@@ -1,5 +1,5 @@
1/**1/**
2 * Copyright © 2012 Akiban Technologies, Inc. All rights2 * Copyright © 2013 Akiban Technologies, Inc. All rights
3 * reserved.3 * reserved.
4 *4 *
5 * This program and the accompanying materials are made available5 * This program and the accompanying materials are made available
@@ -23,4 +23,5 @@
23 public JoinType getJoinType();23 public JoinType getJoinType();
24 public IndexColumnList getIndexColumnList();24 public IndexColumnList getIndexColumnList();
25 public TableName getObjectName();25 public TableName getObjectName();
26
26}27}
2728
=== modified file 'src/main/javacc/SQLGrammar.jj'
--- src/main/javacc/SQLGrammar.jj 2013-04-11 18:47:18 +0000
+++ src/main/javacc/SQLGrammar.jj 2013-04-17 18:33:28 +0000
@@ -10122,6 +10122,7 @@
10122 {10122 {
10123 return (StatementNode)nodeFactory.getNode(NodeTypes.DROP_SEQUENCE_NODE,10123 return (StatementNode)nodeFactory.getNode(NodeTypes.DROP_SEQUENCE_NODE,
10124 sequenceName,10124 sequenceName,
10125 new Integer(StatementType.DROP_RESTRICT),
10125 cond,10126 cond,
10126 parserContext);10127 parserContext);
10127 }10128 }
1012810129
=== modified file 'src/test/resources/com/akiban/sql/parser/drop-sequence-1.expected'
--- src/test/resources/com/akiban/sql/parser/drop-sequence-1.expected 2012-08-14 03:53:33 +0000
+++ src/test/resources/com/akiban/sql/parser/drop-sequence-1.expected 2013-04-17 18:33:28 +0000
@@ -1,4 +1,5 @@
1com.akiban.sql.parser.DropSequenceNode@16bdb5031com.akiban.sql.parser.DropSequenceNode@16bdb503
2name: test.bad_sequence2name: test.bad_sequence
3statementType: DROP SEQUENCE bad_sequence3statementType: DROP SEQUENCE bad_sequence
4dropBehavior: 1
4existenceCheck: NO_CONDITION5existenceCheck: NO_CONDITION
5\ No newline at end of file6\ No newline at end of file
67
=== modified file 'src/test/resources/com/akiban/sql/parser/drop-sequence-2.expected'
--- src/test/resources/com/akiban/sql/parser/drop-sequence-2.expected 2012-08-14 03:53:33 +0000
+++ src/test/resources/com/akiban/sql/parser/drop-sequence-2.expected 2013-04-17 18:33:28 +0000
@@ -1,4 +1,5 @@
1com.akiban.sql.parser.DropSequenceNode@62c095541com.akiban.sql.parser.DropSequenceNode@62c09554
2name: test.new_sequence2name: test.new_sequence
3statementType: DROP SEQUENCE new_sequence3statementType: DROP SEQUENCE new_sequence
4dropBehavior: 1
4existenceCheck: IF_EXISTS5existenceCheck: IF_EXISTS
5\ No newline at end of file6\ No newline at end of file

Subscribers

People subscribed via source and target branches