Update IF NOT EXISTS and IF EXISTS deprecated message

Removed the version that it would be removed in as we will not be
removing it for 1.0.
pull/6706/head
Jonathan A. Sternberg 2016-05-24 09:50:22 -04:00
parent 6a3f7f5ded
commit 1518e5eb2c
2 changed files with 12 additions and 5 deletions

View File

@ -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",

View File

@ -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 {