Skip to content

Commit

Permalink
fix: plugins_configurations dao :select_distinct()
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed Apr 21, 2015
1 parent b32e491 commit 1947fc1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions kong/dao/cassandra/base_dao.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ end
function BaseDao:_check_unique(statement, t, is_updating)
local results, err = self:_execute(statement, t)
if err then
return false, "Error during UNIQUE check: "..err
return false, "Error during UNIQUE check: "..err.message
elseif results and #results > 0 then
if not is_updating then
return false
Expand Down Expand Up @@ -118,7 +118,7 @@ end
function BaseDao:_check_foreign(statement, t)
local results, err = self:_execute(statement, t)
if err then
return false, "Error during FOREIGN check: "..err
return false, "Error during FOREIGN check: "..err.message
elseif not results or #results == 0 then
return false
else
Expand Down
2 changes: 1 addition & 1 deletion kong/dao/cassandra/plugins_configurations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function PluginsConfigurations:find_distinct()

-- Execute query
local distinct_names = {}
for _, rows, page, err in session:execute(self._queries.select.query, nil, {auto_paging=true}) do
for _, rows, page, err in session:execute(string.format(self._queries.select.query, ""), nil, {auto_paging=true}) do
if err then
return nil, err
end
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/cli/start_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local utils = require "kong.tools.utils"
local yaml = require "yaml"
local IO = require "kong.tools.io"

local TEST_CONF = "kong_TEST.yml"
local TEST_CONF = spec_helper.get_env().conf_file
local SERVER_CONF = "kong_TEST_SERVER.yml"

local function replace_conf_property(key, value)
Expand Down
8 changes: 7 additions & 1 deletion spec/spec_helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ function _M.prepare_db(conf_file)
error(err)
end

-- 3. Seed DB with our default data. This will throw any necessary error
-- 3. Prepare
local err = env.dao_factory:prepare()
if err then
error(err)
end

-- 4. Seed DB with our default data. This will throw any necessary error
env.faker:seed()
end

Expand Down
1 change: 0 additions & 1 deletion spec/unit/dao/cassandra_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,6 @@ describe("Cassandra DAO", function()
end)

it("should find distinct plugins configurations", function()
pending("Waiting for driver fix #50")
local res, err = dao_factory.plugins_configurations:find_distinct()

assert.falsy(err)
Expand Down

0 comments on commit 1947fc1

Please sign in to comment.