Commit 8297e4b4 authored by ram@gw.mysql.r18.ru's avatar ram@gw.mysql.r18.ru

Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.0

into gw.mysql.r18.ru:/usr/home/ram/work/4.0.b3738
parents fb9257dc 605962a9
...@@ -206,3 +206,20 @@ WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) ) ...@@ -206,3 +206,20 @@ WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) )
OR ( r = 1 AND a IN ( 3 ) AND ( u = 'w/U' OR u LIKE 'w/U/%' ) ) OR ( r = 1 AND a IN ( 3 ) AND ( u = 'w/U' OR u LIKE 'w/U/%' ) )
OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) ); OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) );
drop table t1; drop table t1;
CREATE TABLE t1 (a VARCHAR(16), UNIQUE(a));
INSERT INTO t1 VALUES ('1'), ('2'), ('3');
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = '2' LIMIT 0, 1;
a
2
SELECT FOUND_ROWS();
FOUND_ROWS()
1
DROP TABLE t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0), (0), (1), (2);
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = 0 GROUP BY a HAVING a > 10;
a
SELECT FOUND_ROWS();
FOUND_ROWS()
0
DROP TABLE t1;
...@@ -127,3 +127,22 @@ WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) ) ...@@ -127,3 +127,22 @@ WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) )
OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) ); OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) );
drop table t1; drop table t1;
#
# Bug #3738: we have a ref key
#
CREATE TABLE t1 (a VARCHAR(16), UNIQUE(a));
INSERT INTO t1 VALUES ('1'), ('2'), ('3');
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = '2' LIMIT 0, 1;
SELECT FOUND_ROWS();
DROP TABLE t1;
#
# Bug #3845: group by, having and empty result
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0), (0), (1), (2);
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = 0 GROUP BY a HAVING a > 10;
SELECT FOUND_ROWS();
DROP TABLE t1;
...@@ -5348,7 +5348,8 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), ...@@ -5348,7 +5348,8 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
if ((join->tables == 1) && !join->tmp_table && !join->sort_and_group if ((join->tables == 1) && !join->tmp_table && !join->sort_and_group
&& !join->send_group_parts && !join->having && !jt->select_cond && && !join->send_group_parts && !join->having && !jt->select_cond &&
!(jt->select && jt->select->quick) && !(jt->select && jt->select->quick) &&
!(jt->table->file->table_flags() & HA_NOT_EXACT_COUNT)) !(jt->table->file->table_flags() & HA_NOT_EXACT_COUNT) &&
(jt->ref.key < 0))
{ {
/* Join over all rows in table; Return number of found rows */ /* Join over all rows in table; Return number of found rows */
TABLE *table=jt->table; TABLE *table=jt->table;
...@@ -5429,7 +5430,8 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), ...@@ -5429,7 +5430,8 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
DBUG_RETURN(-1); /* purecov: inspected */ DBUG_RETURN(-1); /* purecov: inspected */
if (end_of_records) if (end_of_records)
{ {
join->send_records++; if (!error)
join->send_records++;
DBUG_RETURN(0); DBUG_RETURN(0);
} }
if (!error && if (!error &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment