Skip to content

Commit c0a76f2

Browse files
committed
[ga-format-pr] Run ./format_repo.sh to fix formatting
1 parent db95360 commit c0a76f2

File tree

4 files changed

+34
-36
lines changed

4 files changed

+34
-36
lines changed

enginetest/memory_engine_test.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -204,27 +204,27 @@ func TestSingleQueryPrepared(t *testing.T) {
204204
func TestSingleScript(t *testing.T) {
205205
//t.Skip()
206206
var scripts = []queries.ScriptTest{
207-
{
208-
Name: "creating invalid procedure doesn't error until it is called",
209-
Assertions: []queries.ScriptTestAssertion{
210-
{
211-
Query: `CREATE PROCEDURE proc1 (OUT out_count INT) READS SQL DATA SELECT COUNT(*) FROM mytable WHERE i = 1 AND s = 'first row' AND func1(i);`,
212-
Expected: []sql.Row{{types.NewOkResult(0)}},
213-
},
214-
{
215-
Query: "CALL proc1(@out_count);",
216-
ExpectedErr: sql.ErrTableNotFound,
217-
},
218-
{
219-
Query: "CREATE TABLE mytable (i int, s varchar(128));",
220-
Expected: []sql.Row{{types.NewOkResult(0)}},
221-
},
222-
{
223-
Query: "CALL proc1(@out_count);",
224-
ExpectedErr: sql.ErrFunctionNotFound,
207+
{
208+
Name: "creating invalid procedure doesn't error until it is called",
209+
Assertions: []queries.ScriptTestAssertion{
210+
{
211+
Query: `CREATE PROCEDURE proc1 (OUT out_count INT) READS SQL DATA SELECT COUNT(*) FROM mytable WHERE i = 1 AND s = 'first row' AND func1(i);`,
212+
Expected: []sql.Row{{types.NewOkResult(0)}},
213+
},
214+
{
215+
Query: "CALL proc1(@out_count);",
216+
ExpectedErr: sql.ErrTableNotFound,
217+
},
218+
{
219+
Query: "CREATE TABLE mytable (i int, s varchar(128));",
220+
Expected: []sql.Row{{types.NewOkResult(0)}},
221+
},
222+
{
223+
Query: "CALL proc1(@out_count);",
224+
ExpectedErr: sql.ErrFunctionNotFound,
225+
},
225226
},
226227
},
227-
},
228228
}
229229

230230
for _, test := range scripts {

enginetest/queries/procedure_queries.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2970,18 +2970,16 @@ var ProcedureCreateInSubroutineTests = []ScriptTest{
29702970
},
29712971
{
29722972
Name: "procedure can CREATE VIEW",
2973-
SetUpScript: []string{
2974-
2975-
},
2973+
SetUpScript: []string{},
29762974
Assertions: []ScriptTestAssertion{
29772975
{
2978-
Query: "create procedure p1() create view v as select 1;",
2976+
Query: "create procedure p1() create view v as select 1;",
29792977
Expected: []sql.Row{
29802978
{types.NewOkResult(0)},
29812979
},
29822980
},
29832981
{
2984-
Query: "create procedure p() begin create view v as select 1; end;",
2982+
Query: "create procedure p() begin create view v as select 1; end;",
29852983
Expected: []sql.Row{
29862984
{types.NewOkResult(0)},
29872985
},

sql/procedures/interpreter_logic.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ func handleError(ctx *sql.Context, stack *InterpreterStack, runner sql.Statement
278278
}
279279
switch handler.Condition {
280280
case ast.DeclareHandlerCondition_MysqlErrorCode:
281-
case ast.DeclareHandlerCondition_SqlState:
282-
case ast.DeclareHandlerCondition_ConditionName:
283-
case ast.DeclareHandlerCondition_SqlWarning:
284-
case ast.DeclareHandlerCondition_NotFound:
281+
case ast.DeclareHandlerCondition_SqlState:
282+
case ast.DeclareHandlerCondition_ConditionName:
283+
case ast.DeclareHandlerCondition_SqlWarning:
284+
case ast.DeclareHandlerCondition_NotFound:
285285
case ast.DeclareHandlerCondition_SqlException:
286286
matchingHandler = handler
287287
break

sql/procedures/interpreter_operation.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ import ast "github.com/dolthub/vitess/go/vt/sqlparser"
1717
type OpCode uint16
1818

1919
const (
20-
OpCode_Select OpCode = iota
21-
OpCode_Declare // https://www.postgresql.org/docs/15/plpgsql-declarations.html
20+
OpCode_Select OpCode = iota
21+
OpCode_Declare // https://www.postgresql.org/docs/15/plpgsql-declarations.html
2222
OpCode_Signal
2323
OpCode_Open
2424
OpCode_Fetch
2525
OpCode_Close
2626
OpCode_Set
27-
OpCode_If // https://www.postgresql.org/docs/15/plpgsql-control-structures.html#PLPGSQL-CONDITIONALS
28-
OpCode_Goto // All control-flow structures can be represented using Goto
29-
OpCode_Execute // Everything that's not a SELECT
30-
OpCode_Exception // https://www.postgresql.org/docs/15/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
31-
OpCode_Return // https://www.postgresql.org/docs/15/plpgsql-control-structures.html#PLPGSQL-STATEMENTS-RETURNING
27+
OpCode_If // https://www.postgresql.org/docs/15/plpgsql-control-structures.html#PLPGSQL-CONDITIONALS
28+
OpCode_Goto // All control-flow structures can be represented using Goto
29+
OpCode_Execute // Everything that's not a SELECT
30+
OpCode_Exception // https://www.postgresql.org/docs/15/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
31+
OpCode_Return // https://www.postgresql.org/docs/15/plpgsql-control-structures.html#PLPGSQL-STATEMENTS-RETURNING
3232
OpCode_ScopeBegin // This is used for scope control, specific to Doltgres
33-
OpCode_ScopeEnd // This is used for scope control, specific to Doltgres
33+
OpCode_ScopeEnd // This is used for scope control, specific to Doltgres
3434
)
3535

3636
// InterpreterOperation is an operation that will be performed by the interpreter.

0 commit comments

Comments
 (0)