diff --git a/cmd/influxd/run/server_suite_test.go b/cmd/influxd/run/server_suite_test.go index edec932b6b..21eeddfc40 100644 --- a/cmd/influxd/run/server_suite_test.go +++ b/cmd/influxd/run/server_suite_test.go @@ -56,12 +56,12 @@ func init() { &Query{ name: "create database should not error with existing database with IF NOT EXISTS", command: `CREATE DATABASE IF NOT EXISTS db0`, - exp: `{"results":[{"messages":[{"level":"warning","text":"IF NOT EXISTS is deprecated as of v0.13.0 and will be removed in v1.0"}]}]}`, + exp: `{"results":[{"messages":[{"level":"warning","text":"IF NOT EXISTS is deprecated as of v0.13.0 and will be removed in a future release"}]}]}`, }, &Query{ name: "create database should create non-existing database with IF NOT EXISTS", command: `CREATE DATABASE IF NOT EXISTS db1`, - exp: `{"results":[{"messages":[{"level":"warning","text":"IF NOT EXISTS is deprecated as of v0.13.0 and will be removed in v1.0"}]}]}`, + exp: `{"results":[{"messages":[{"level":"warning","text":"IF NOT EXISTS is deprecated as of v0.13.0 and will be removed in a future release"}]}]}`, }, &Query{ name: "create database with retention duration should error if retention policy is different with IF NOT EXISTS", @@ -104,7 +104,7 @@ func init() { &Query{ name: "drop database should not error with non-existing database db1 WITH IF EXISTS", command: `DROP DATABASE IF EXISTS db1`, - exp: `{"results":[{}]}`, + exp: `{"results":[{"messages":[{"level":"warning","text":"IF EXISTS is deprecated as of v0.13.0 and will be removed in a future release"}]}]}`, }, &Query{ name: "show database should have no results", diff --git a/coordinator/statement_executor.go b/coordinator/statement_executor.go index 629fd71e22..d47812f6cc 100644 --- a/coordinator/statement_executor.go +++ b/coordinator/statement_executor.go @@ -63,10 +63,10 @@ func (e *StatementExecutor) ExecuteStatement(stmt influxql.Statement, ctx *influ messages = append(messages, influxql.ReadOnlyWarning(stmt.String())) } if stmt.IfNotExists { - ctx.Log.Println("WARNING: IF NOT EXISTS is deprecated as of v0.13.0 and will be removed in v1.0") + ctx.Log.Println("WARNING: IF NOT EXISTS is deprecated as of v0.13.0 and will be removed in a future release") messages = append(messages, &influxql.Message{ Level: influxql.WarningLevel, - Text: "IF NOT EXISTS is deprecated as of v0.13.0 and will be removed in v1.0", + Text: "IF NOT EXISTS is deprecated as of v0.13.0 and will be removed in a future release", }) } err = e.executeCreateDatabaseStatement(stmt) @@ -96,6 +96,13 @@ func (e *StatementExecutor) ExecuteStatement(stmt influxql.Statement, ctx *influ if ctx.ReadOnly { messages = append(messages, influxql.ReadOnlyWarning(stmt.String())) } + if stmt.IfExists { + ctx.Log.Println("WARNING: IF EXISTS is deprecated as of v0.13.0 and will be removed in a future release") + messages = append(messages, &influxql.Message{ + Level: influxql.WarningLevel, + Text: "IF EXISTS is deprecated as of v0.13.0 and will be removed in a future release", + }) + } err = e.executeDropDatabaseStatement(stmt) case *influxql.DropMeasurementStatement: if ctx.ReadOnly {