Navigation Menu

Skip to content

Commit

Permalink
test: add for a bug that records_in_range returns 0 unexpectedly
Browse files Browse the repository at this point in the history
This is groonga's bug. It will be fixed soon in groonga. It is not
related to neither single column index nor multiple column index.

[groonga-dev,01192]

Reported by b senboku. Thanks!!!
  • Loading branch information
kou committed Feb 9, 2013
1 parent a2a9f12 commit d77dc95
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 0 deletions.
@@ -0,0 +1,18 @@
DROP TABLE IF EXISTS scores;
SET NAMES utf8;
CREATE TABLE scores (
deleted BOOLEAN,
value INT,
INDEX (deleted, value)
);
INSERT INTO scores VALUES (FALSE, 1);
INSERT INTO scores VALUES (FALSE, 1);
INSERT INTO scores VALUES (FALSE, 2);
SELECT count(*) FROM scores WHERE deleted = FALSE;
count(*)
3
UPDATE scores SET deleted = TRUE WHERE value = 1;
SELECT count(*) FROM scores WHERE deleted = FALSE;
count(*)
1
DROP TABLE scores;
17 changes: 17 additions & 0 deletions test/sql/suite/mroonga/storage/index/update/r/single_column.result
@@ -0,0 +1,17 @@
DROP TABLE IF EXISTS scores;
SET NAMES utf8;
CREATE TABLE scores (
value INT,
INDEX (value)
);
INSERT INTO scores VALUES (21);
INSERT INTO scores VALUES (21);
INSERT INTO scores VALUES (22);
SELECT count(*) FROM scores WHERE value >= 20;
count(*)
3
UPDATE scores SET value = 11 WHERE value = 21;
SELECT count(*) FROM scores WHERE value >= 20;
count(*)
1
DROP TABLE scores;
40 changes: 40 additions & 0 deletions test/sql/suite/mroonga/storage/index/update/t/multiple_column.test
@@ -0,0 +1,40 @@
# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

--source include/have_mroonga.inc

--disable_warnings
DROP TABLE IF EXISTS scores;
--enable_warnings

SET NAMES utf8;
CREATE TABLE scores (
deleted BOOLEAN,
value INT,
INDEX (deleted, value)
);

INSERT INTO scores VALUES (FALSE, 1);
INSERT INTO scores VALUES (FALSE, 1);
INSERT INTO scores VALUES (FALSE, 2);

SELECT count(*) FROM scores WHERE deleted = FALSE;
UPDATE scores SET deleted = TRUE WHERE value = 1;
SELECT count(*) FROM scores WHERE deleted = FALSE;

DROP TABLE scores;

--source include/have_mroonga_deinit.inc
39 changes: 39 additions & 0 deletions test/sql/suite/mroonga/storage/index/update/t/single_column.test
@@ -0,0 +1,39 @@
# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

--source include/have_mroonga.inc

--disable_warnings
DROP TABLE IF EXISTS scores;
--enable_warnings

SET NAMES utf8;
CREATE TABLE scores (
value INT,
INDEX (value)
);

INSERT INTO scores VALUES (21);
INSERT INTO scores VALUES (21);
INSERT INTO scores VALUES (22);

SELECT count(*) FROM scores WHERE value >= 20;
UPDATE scores SET value = 11 WHERE value = 21;
SELECT count(*) FROM scores WHERE value >= 20;

DROP TABLE scores;

--source include/have_mroonga_deinit.inc

0 comments on commit d77dc95

Please sign in to comment.