From f37ec653d1871c8557013f8ea368f1dbafcd2784 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Wed, 21 Sep 2016 00:34:21 +0100 Subject: [PATCH] Remove SQL EXPLAIN command --- db/create.go | 4 ---- db/define.go | 16 ---------------- db/delete.go | 4 ---- db/info.go | 4 ---- db/modify.go | 4 ---- db/remove.go | 16 ---------------- db/select.go | 4 ---- db/update.go | 4 ---- sql/ast.go | 16 ---------------- sql/create.go | 4 +--- sql/define.go | 10 +++++----- sql/delete.go | 4 +--- sql/field.go | 8 ++------ sql/index.go | 8 ++------ sql/info.go | 4 +--- sql/modify.go | 4 +--- sql/parser.go | 34 ++++++++++++++-------------------- sql/record.go | 4 +--- sql/relate.go | 4 +--- sql/remove.go | 10 +++++----- sql/rules.go | 8 ++------ sql/select.go | 4 +--- sql/sql_test.go | 19 ------------------- sql/table.go | 8 ++------ sql/token.go | 2 -- sql/trans.go | 6 +++--- sql/update.go | 4 +--- sql/use.go | 2 +- 28 files changed, 44 insertions(+), 175 deletions(-) diff --git a/db/create.go b/db/create.go index 88a08127..a1ddb23e 100644 --- a/db/create.go +++ b/db/create.go @@ -26,10 +26,6 @@ func executeCreateStatement(txn kvs.TX, ast *sql.CreateStatement) (out []interfa var local bool - if ast.EX { - return append(out, ast), nil - } - if txn == nil { local = true txn, err = db.Txn(true) diff --git a/db/define.go b/db/define.go index 72c7c0a0..8bb74eac 100644 --- a/db/define.go +++ b/db/define.go @@ -26,10 +26,6 @@ func executeDefineTableStatement(txn kvs.TX, ast *sql.DefineTableStatement) (out var local bool - if ast.EX { - return append(out, ast), nil - } - if txn == nil { local = true txn, err = db.Txn(true) @@ -67,10 +63,6 @@ func executeDefineRulesStatement(txn kvs.TX, ast *sql.DefineRulesStatement) (out var local bool - if ast.EX { - return append(out, ast), nil - } - if txn == nil { local = true txn, err = db.Txn(true) @@ -118,10 +110,6 @@ func executeDefineFieldStatement(txn kvs.TX, ast *sql.DefineFieldStatement) (out var local bool - if ast.EX { - return append(out, ast), nil - } - if txn == nil { local = true txn, err = db.Txn(true) @@ -165,10 +153,6 @@ func executeDefineIndexStatement(txn kvs.TX, ast *sql.DefineIndexStatement) (out var local bool - if ast.EX { - return append(out, ast), nil - } - if txn == nil { local = true txn, err = db.Txn(true) diff --git a/db/delete.go b/db/delete.go index 2a35043f..f603453f 100644 --- a/db/delete.go +++ b/db/delete.go @@ -25,10 +25,6 @@ func executeDeleteStatement(txn kvs.TX, ast *sql.DeleteStatement) (out []interfa var local bool - if ast.EX { - return append(out, ast), nil - } - if txn == nil { local = true txn, err = db.Txn(true) diff --git a/db/info.go b/db/info.go index f4d1de5a..11106e13 100644 --- a/db/info.go +++ b/db/info.go @@ -25,10 +25,6 @@ import ( func executeInfoStatement(txn kvs.TX, ast *sql.InfoStatement) (out []interface{}, err error) { - if ast.EX { - return append(out, ast), nil - } - if txn == nil { txn, err = db.Txn(false) if err != nil { diff --git a/db/modify.go b/db/modify.go index 9e6ed5c4..8f6323ae 100644 --- a/db/modify.go +++ b/db/modify.go @@ -25,10 +25,6 @@ func executeModifyStatement(txn kvs.TX, ast *sql.ModifyStatement) (out []interfa var local bool - if ast.EX { - return append(out, ast), nil - } - if txn == nil { local = true txn, err = db.Txn(true) diff --git a/db/remove.go b/db/remove.go index 57967660..2f9f38a7 100644 --- a/db/remove.go +++ b/db/remove.go @@ -24,10 +24,6 @@ func executeRemoveTableStatement(txn kvs.TX, ast *sql.RemoveTableStatement) (out var local bool - if ast.EX { - return append(out, ast), nil - } - if txn == nil { local = true txn, err = db.Txn(true) @@ -83,10 +79,6 @@ func executeRemoveRulesStatement(txn kvs.TX, ast *sql.RemoveRulesStatement) (out var local bool - if ast.EX { - return append(out, ast), nil - } - if txn == nil { local = true txn, err = db.Txn(true) @@ -122,10 +114,6 @@ func executeRemoveFieldStatement(txn kvs.TX, ast *sql.RemoveFieldStatement) (out var local bool - if ast.EX { - return append(out, ast), nil - } - if txn == nil { local = true txn, err = db.Txn(true) @@ -157,10 +145,6 @@ func executeRemoveIndexStatement(txn kvs.TX, ast *sql.RemoveIndexStatement) (out var local bool - if ast.EX { - return append(out, ast), nil - } - if txn == nil { local = true txn, err = db.Txn(true) diff --git a/db/select.go b/db/select.go index 9db73790..3543fb2c 100644 --- a/db/select.go +++ b/db/select.go @@ -23,10 +23,6 @@ import ( func executeSelectStatement(txn kvs.TX, ast *sql.SelectStatement) (out []interface{}, err error) { - if ast.EX { - return append(out, ast), nil - } - if txn == nil { txn, err = db.Txn(false) if err != nil { diff --git a/db/update.go b/db/update.go index 33b2b301..e062d71e 100644 --- a/db/update.go +++ b/db/update.go @@ -25,10 +25,6 @@ func executeUpdateStatement(txn kvs.TX, ast *sql.UpdateStatement) (out []interfa var local bool - if ast.EX { - return append(out, ast), nil - } - if txn == nil { local = true txn, err = db.Txn(true) diff --git a/sql/ast.go b/sql/ast.go index cef36831..1e707cc6 100644 --- a/sql/ast.go +++ b/sql/ast.go @@ -64,7 +64,6 @@ type UseStatement struct { // InfoStatement represents an SQL INFO statement. type InfoStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -77,7 +76,6 @@ type InfoStatement struct { // SelectStatement represents a SQL SELECT statement. type SelectStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -94,7 +92,6 @@ type SelectStatement struct { // CreateStatement represents a SQL CREATE statement. type CreateStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -105,7 +102,6 @@ type CreateStatement struct { // UpdateStatement represents a SQL UPDATE statement. type UpdateStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -117,7 +113,6 @@ type UpdateStatement struct { // ModifyStatement represents a SQL MODIFY statement. type ModifyStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -129,7 +124,6 @@ type ModifyStatement struct { // DeleteStatement represents a SQL DELETE statement. type DeleteStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -141,7 +135,6 @@ type DeleteStatement struct { // RelateStatement represents a SQL RELATE statement. type RelateStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -154,7 +147,6 @@ type RelateStatement struct { // RecordStatement represents a SQL RECORD statement. type RecordStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -170,7 +162,6 @@ type RecordStatement struct { // DefineTableStatement represents an SQL DEFINE TABLE statement. type DefineTableStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -179,7 +170,6 @@ type DefineTableStatement struct { // RemoveTableStatement represents an SQL REMOVE TABLE statement. type RemoveTableStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -192,7 +182,6 @@ type RemoveTableStatement struct { // DefineRulesStatement represents an SQL DEFINE RULES statement. type DefineRulesStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -204,7 +193,6 @@ type DefineRulesStatement struct { // RemoveRulesStatement represents an SQL REMOVE RULES statement. type RemoveRulesStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -218,7 +206,6 @@ type RemoveRulesStatement struct { // DefineFieldStatement represents an SQL DEFINE FIELD statement. type DefineFieldStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -239,7 +226,6 @@ type DefineFieldStatement struct { // RemoveFieldStatement represents an SQL REMOVE FIELD statement. type RemoveFieldStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -253,7 +239,6 @@ type RemoveFieldStatement struct { // DefineIndexStatement represents an SQL DEFINE INDEX statement. type DefineIndexStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` @@ -265,7 +250,6 @@ type DefineIndexStatement struct { // RemoveIndexStatement represents an SQL REMOVE INDEX statement. type RemoveIndexStatement struct { - EX bool `codec:"-"` KV string `codec:"-"` NS string `codec:"-"` DB string `codec:"-"` diff --git a/sql/create.go b/sql/create.go index 083e317e..cc3948b9 100644 --- a/sql/create.go +++ b/sql/create.go @@ -14,12 +14,10 @@ package sql -func (p *parser) parseCreateStatement(explain bool) (stmt *CreateStatement, err error) { +func (p *parser) parseCreateStatement() (stmt *CreateStatement, err error) { stmt = &CreateStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) diff --git a/sql/define.go b/sql/define.go index c4c489d6..4edb0d6e 100644 --- a/sql/define.go +++ b/sql/define.go @@ -14,20 +14,20 @@ package sql -func (p *parser) parseDefineStatement(explain bool) (Statement, error) { +func (p *parser) parseDefineStatement() (Statement, error) { // Inspect the next token. tok, _, err := p.shouldBe(TABLE, RULES, FIELD, INDEX) switch tok { case TABLE: - return p.parseDefineTableStatement(explain) + return p.parseDefineTableStatement() case RULES: - return p.parseDefineRulesStatement(explain) + return p.parseDefineRulesStatement() case FIELD: - return p.parseDefineFieldStatement(explain) + return p.parseDefineFieldStatement() case INDEX: - return p.parseDefineIndexStatement(explain) + return p.parseDefineIndexStatement() default: return nil, err } diff --git a/sql/delete.go b/sql/delete.go index a155f27c..9b0d465c 100644 --- a/sql/delete.go +++ b/sql/delete.go @@ -14,12 +14,10 @@ package sql -func (p *parser) parseDeleteStatement(explain bool) (stmt *DeleteStatement, err error) { +func (p *parser) parseDeleteStatement() (stmt *DeleteStatement, err error) { stmt = &DeleteStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) diff --git a/sql/field.go b/sql/field.go index 27ce55f2..b4218f08 100644 --- a/sql/field.go +++ b/sql/field.go @@ -14,12 +14,10 @@ package sql -func (p *parser) parseDefineFieldStatement(explain bool) (stmt *DefineFieldStatement, err error) { +func (p *parser) parseDefineFieldStatement() (stmt *DefineFieldStatement, err error) { stmt = &DefineFieldStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) @@ -135,12 +133,10 @@ func (p *parser) parseDefineFieldStatement(explain bool) (stmt *DefineFieldState } -func (p *parser) parseRemoveFieldStatement(explain bool) (stmt *RemoveFieldStatement, err error) { +func (p *parser) parseRemoveFieldStatement() (stmt *RemoveFieldStatement, err error) { stmt = &RemoveFieldStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) diff --git a/sql/index.go b/sql/index.go index 06a8c296..8757d840 100644 --- a/sql/index.go +++ b/sql/index.go @@ -14,12 +14,10 @@ package sql -func (p *parser) parseDefineIndexStatement(explain bool) (stmt *DefineIndexStatement, err error) { +func (p *parser) parseDefineIndexStatement() (stmt *DefineIndexStatement, err error) { stmt = &DefineIndexStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) @@ -54,12 +52,10 @@ func (p *parser) parseDefineIndexStatement(explain bool) (stmt *DefineIndexState } -func (p *parser) parseRemoveIndexStatement(explain bool) (stmt *RemoveIndexStatement, err error) { +func (p *parser) parseRemoveIndexStatement() (stmt *RemoveIndexStatement, err error) { stmt = &RemoveIndexStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) diff --git a/sql/info.go b/sql/info.go index fd81de48..b6a3f5b0 100644 --- a/sql/info.go +++ b/sql/info.go @@ -14,12 +14,10 @@ package sql -func (p *parser) parseInfoStatement(explain bool) (stmt *InfoStatement, err error) { +func (p *parser) parseInfoStatement() (stmt *InfoStatement, err error) { stmt = &InfoStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) diff --git a/sql/modify.go b/sql/modify.go index a60d5fce..bc32c80a 100644 --- a/sql/modify.go +++ b/sql/modify.go @@ -14,12 +14,10 @@ package sql -func (p *parser) parseModifyStatement(explain bool) (stmt *ModifyStatement, err error) { +func (p *parser) parseModifyStatement() (stmt *ModifyStatement, err error) { stmt = &ModifyStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) diff --git a/sql/parser.go b/sql/parser.go index 1b74458a..8ef83b7a 100644 --- a/sql/parser.go +++ b/sql/parser.go @@ -115,48 +115,42 @@ func (p *parser) parseMulti() (*Query, error) { // parseSingle parses a single SQL SELECT statement. func (p *parser) parseSingle() (Statement, error) { - var explain bool - - if _, _, exi := p.mightBe(EXPLAIN); exi { - explain = true - } - tok, _, err := p.shouldBe(USE, INFO, LET, BEGIN, CANCEL, COMMIT, ROLLBACK, SELECT, CREATE, UPDATE, INSERT, UPSERT, MODIFY, DELETE, RELATE, RECORD, DEFINE, REMOVE) switch tok { case USE: - return p.parseUseStatement(explain) + return p.parseUseStatement() case INFO: - return p.parseInfoStatement(explain) + return p.parseInfoStatement() case BEGIN: - return p.parseBeginStatement(explain) + return p.parseBeginStatement() case CANCEL, ROLLBACK: - return p.parseCancelStatement(explain) + return p.parseCancelStatement() case COMMIT: - return p.parseCommitStatement(explain) + return p.parseCommitStatement() case SELECT: - return p.parseSelectStatement(explain) + return p.parseSelectStatement() case CREATE, INSERT: - return p.parseCreateStatement(explain) + return p.parseCreateStatement() case UPDATE, UPSERT: - return p.parseUpdateStatement(explain) + return p.parseUpdateStatement() case MODIFY: - return p.parseModifyStatement(explain) + return p.parseModifyStatement() case DELETE: - return p.parseDeleteStatement(explain) + return p.parseDeleteStatement() case RELATE: - return p.parseRelateStatement(explain) + return p.parseRelateStatement() case RECORD: - return p.parseRecordStatement(explain) + return p.parseRecordStatement() case DEFINE: - return p.parseDefineStatement(explain) + return p.parseDefineStatement() case REMOVE: - return p.parseRemoveStatement(explain) + return p.parseRemoveStatement() default: return nil, err diff --git a/sql/record.go b/sql/record.go index 706505be..ca7dbd2f 100644 --- a/sql/record.go +++ b/sql/record.go @@ -14,12 +14,10 @@ package sql -func (p *parser) parseRecordStatement(explain bool) (stmt *RecordStatement, err error) { +func (p *parser) parseRecordStatement() (stmt *RecordStatement, err error) { stmt = &RecordStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) diff --git a/sql/relate.go b/sql/relate.go index 4e3230c4..f1e9c5da 100644 --- a/sql/relate.go +++ b/sql/relate.go @@ -14,12 +14,10 @@ package sql -func (p *parser) parseRelateStatement(explain bool) (stmt *RelateStatement, err error) { +func (p *parser) parseRelateStatement() (stmt *RelateStatement, err error) { stmt = &RelateStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) diff --git a/sql/remove.go b/sql/remove.go index 4e6aa472..66cbf02d 100644 --- a/sql/remove.go +++ b/sql/remove.go @@ -14,20 +14,20 @@ package sql -func (p *parser) parseRemoveStatement(explain bool) (Statement, error) { +func (p *parser) parseRemoveStatement() (Statement, error) { // Inspect the next token. tok, _, err := p.shouldBe(TABLE, RULES, FIELD, INDEX) switch tok { case TABLE: - return p.parseRemoveTableStatement(explain) + return p.parseRemoveTableStatement() case RULES: - return p.parseRemoveRulesStatement(explain) + return p.parseRemoveRulesStatement() case FIELD: - return p.parseRemoveFieldStatement(explain) + return p.parseRemoveFieldStatement() case INDEX: - return p.parseRemoveIndexStatement(explain) + return p.parseRemoveIndexStatement() default: return nil, err } diff --git a/sql/rules.go b/sql/rules.go index b8de92fe..d7c6e947 100644 --- a/sql/rules.go +++ b/sql/rules.go @@ -14,12 +14,10 @@ package sql -func (p *parser) parseDefineRulesStatement(explain bool) (stmt *DefineRulesStatement, err error) { +func (p *parser) parseDefineRulesStatement() (stmt *DefineRulesStatement, err error) { stmt = &DefineRulesStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) @@ -77,12 +75,10 @@ func (p *parser) parseDefineRulesStatement(explain bool) (stmt *DefineRulesState } -func (p *parser) parseRemoveRulesStatement(explain bool) (stmt *RemoveRulesStatement, err error) { +func (p *parser) parseRemoveRulesStatement() (stmt *RemoveRulesStatement, err error) { stmt = &RemoveRulesStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) diff --git a/sql/select.go b/sql/select.go index 7163c79f..e87a4981 100644 --- a/sql/select.go +++ b/sql/select.go @@ -14,12 +14,10 @@ package sql -func (p *parser) parseSelectStatement(explain bool) (stmt *SelectStatement, err error) { +func (p *parser) parseSelectStatement() (stmt *SelectStatement, err error) { stmt = &SelectStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) diff --git a/sql/sql_test.go b/sql/sql_test.go index 53331a04..24bc7e26 100644 --- a/sql/sql_test.go +++ b/sql/sql_test.go @@ -249,25 +249,6 @@ func Test_Parse_Queries_Use(t *testing.T) { } -func Test_Parse_Queries_Explain(t *testing.T) { - - var tests = []tester{ - { - sql: `EXPLAIN SELECT ALL FROM person`, - res: &Query{Statements: []Statement{&SelectStatement{ - EX: true, - Expr: []*Field{{Expr: &All{}, Alias: "ALL"}}, - What: []Expr{&Table{"person"}}, - }}}, - }, - } - - for _, test := range tests { - testsql(t, test) - } - -} - func Test_Parse_Queries_Select(t *testing.T) { date, _ := time.Parse("2006-01-02", "1987-06-22") diff --git a/sql/table.go b/sql/table.go index 3ebc8d8e..60900d6c 100644 --- a/sql/table.go +++ b/sql/table.go @@ -14,12 +14,10 @@ package sql -func (p *parser) parseDefineTableStatement(explain bool) (stmt *DefineTableStatement, err error) { +func (p *parser) parseDefineTableStatement() (stmt *DefineTableStatement, err error) { stmt = &DefineTableStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) @@ -36,12 +34,10 @@ func (p *parser) parseDefineTableStatement(explain bool) (stmt *DefineTableState } -func (p *parser) parseRemoveTableStatement(explain bool) (stmt *RemoveTableStatement, err error) { +func (p *parser) parseRemoveTableStatement() (stmt *RemoveTableStatement, err error) { stmt = &RemoveTableStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) diff --git a/sql/token.go b/sql/token.go index 7aff293f..415f8ee4 100644 --- a/sql/token.go +++ b/sql/token.go @@ -124,7 +124,6 @@ const ( DISTINCT EMPTY ENUM - EXPLAIN EXPUNGE FALSE FIELD @@ -284,7 +283,6 @@ var tokens = [...]string{ DISTINCT: "DISTINCT", EMPTY: "EMPTY", ENUM: "ENUM", - EXPLAIN: "EXPLAIN", EXPUNGE: "EXPUNGE", FALSE: "FALSE", FIELD: "FIELD", diff --git a/sql/trans.go b/sql/trans.go index d700d452..121f2b48 100644 --- a/sql/trans.go +++ b/sql/trans.go @@ -14,7 +14,7 @@ package sql -func (p *parser) parseBeginStatement(explain bool) (stmt *BeginStatement, err error) { +func (p *parser) parseBeginStatement() (stmt *BeginStatement, err error) { stmt = &BeginStatement{} @@ -28,7 +28,7 @@ func (p *parser) parseBeginStatement(explain bool) (stmt *BeginStatement, err er } -func (p *parser) parseCancelStatement(explain bool) (stmt *CancelStatement, err error) { +func (p *parser) parseCancelStatement() (stmt *CancelStatement, err error) { stmt = &CancelStatement{} @@ -42,7 +42,7 @@ func (p *parser) parseCancelStatement(explain bool) (stmt *CancelStatement, err } -func (p *parser) parseCommitStatement(explain bool) (stmt *CommitStatement, err error) { +func (p *parser) parseCommitStatement() (stmt *CommitStatement, err error) { stmt = &CommitStatement{} diff --git a/sql/update.go b/sql/update.go index 9b8a71aa..33cba635 100644 --- a/sql/update.go +++ b/sql/update.go @@ -14,12 +14,10 @@ package sql -func (p *parser) parseUpdateStatement(explain bool) (stmt *UpdateStatement, err error) { +func (p *parser) parseUpdateStatement() (stmt *UpdateStatement, err error) { stmt = &UpdateStatement{} - stmt.EX = explain - stmt.KV = p.c.Get("KV").(string) stmt.NS = p.c.Get("NS").(string) stmt.DB = p.c.Get("DB").(string) diff --git a/sql/use.go b/sql/use.go index 30ca3fad..fa6bf237 100644 --- a/sql/use.go +++ b/sql/use.go @@ -14,7 +14,7 @@ package sql -func (p *parser) parseUseStatement(explain bool) (stmt *UseStatement, err error) { +func (p *parser) parseUseStatement() (stmt *UseStatement, err error) { stmt = &UseStatement{}