Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
30d5eb22
Commit
30d5eb22
authored
Jun 10, 2002
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/home/bk/mysql-4.0 into hundin.mysql.fi:/my/bk/mysql-4.0
parents
5de96e3b
45e0cd61
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
3 deletions
+50
-3
Docs/manual.texi
Docs/manual.texi
+2
-0
mysql-test/r/select_found.result
mysql-test/r/select_found.result
+17
-1
mysql-test/t/select_found.test
mysql-test/t/select_found.test
+17
-0
sql/sql_select.cc
sql/sql_select.cc
+14
-2
No files found.
Docs/manual.texi
View file @
30d5eb22
...
@@ -49402,6 +49402,8 @@ if the first @code{SELECT} has this option and if there is global @code{LIMIT}
...
@@ -49402,6 +49402,8 @@ if the first @code{SELECT} has this option and if there is global @code{LIMIT}
for the entire statement. For the moment, this requires using parentheses for
for the entire statement. For the moment, this requires using parentheses for
individual @code{SELECT} queries within the statement.
individual @code{SELECT} queries within the statement.
@item
@item
Fixed bug in @code{SQL_CALC_FOUND_ROWS} and LIMIT.
@item
Don't give an error for @code{CREATE TABLE ...(... VARCHAR(0))}.
Don't give an error for @code{CREATE TABLE ...(... VARCHAR(0))}.
@item
@item
Fixed @code{SIGINT} and @code{SIGQUIT} problems in @file{mysql.cc} on Linux
Fixed @code{SIGINT} and @code{SIGQUIT} problems in @file{mysql.cc} on Linux
mysql-test/r/select_found.result
View file @
30d5eb22
...
@@ -66,7 +66,7 @@ a
...
@@ -66,7 +66,7 @@ a
2
2
select FOUND_ROWS();
select FOUND_ROWS();
FOUND_ROWS()
FOUND_ROWS()
5
3
drop table t1;
drop table t1;
CREATE TABLE t1 (
CREATE TABLE t1 (
`id` smallint(5) unsigned NOT NULL auto_increment,
`id` smallint(5) unsigned NOT NULL auto_increment,
...
@@ -153,3 +153,19 @@ SELECT FOUND_ROWS();
...
@@ -153,3 +153,19 @@ SELECT FOUND_ROWS();
FOUND_ROWS()
FOUND_ROWS()
199
199
drop table t1,t2;
drop table t1,t2;
CREATE TABLE `t1` (
`titre` char(80) NOT NULL default '',
`numeropost` mediumint(8) unsigned NOT NULL auto_increment,
`maxnumrep` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`numeropost`),
KEY `maxnumrep` (`maxnumrep`)
) TYPE=MyISAM ROW_FORMAT=FIXED;
INSERT INTO t1 (titre,maxnumrep) VALUES
('test1','1'),('test2','2'),('test3','3');
SELECT SQL_CALC_FOUND_ROWS titre,numeropost,maxnumrep FROM t1 WHERE numeropost IN (1,2) ORDER BY maxnumrep DESC LIMIT 0, 1;
titre numeropost maxnumrep
test2 2 2
SELECT FOUND_ROWS();
FOUND_ROWS()
2
drop table t1;
mysql-test/t/select_found.test
View file @
30d5eb22
...
@@ -68,3 +68,20 @@ SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id W
...
@@ -68,3 +68,20 @@ SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id W
SELECT
FOUND_ROWS
();
SELECT
FOUND_ROWS
();
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# Test bug when using range optimization
#
CREATE
TABLE
`t1`
(
`titre`
char
(
80
)
NOT
NULL
default
''
,
`numeropost`
mediumint
(
8
)
unsigned
NOT
NULL
auto_increment
,
`maxnumrep`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
PRIMARY
KEY
(
`numeropost`
),
KEY
`maxnumrep`
(
`maxnumrep`
)
)
TYPE
=
MyISAM
ROW_FORMAT
=
FIXED
;
INSERT
INTO
t1
(
titre
,
maxnumrep
)
VALUES
(
'test1'
,
'1'
),(
'test2'
,
'2'
),(
'test3'
,
'3'
);
SELECT
SQL_CALC_FOUND_ROWS
titre
,
numeropost
,
maxnumrep
FROM
t1
WHERE
numeropost
IN
(
1
,
2
)
ORDER
BY
maxnumrep
DESC
LIMIT
0
,
1
;
SELECT
FOUND_ROWS
();
drop
table
t1
;
sql/sql_select.cc
View file @
30d5eb22
...
@@ -4900,12 +4900,24 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
...
@@ -4900,12 +4900,24 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
JOIN_TAB
*
jt
=
join
->
join_tab
;
JOIN_TAB
*
jt
=
join
->
join_tab
;
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
->
table
->
file
->
table_flags
()
&
HA_NOT_EXACT_COUNT
))
!
(
jt
->
table
->
file
->
table_flags
()
&
HA_NOT_EXACT_COUNT
))
{
{
/* 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
;
join
->
select_options
^=
OPTION_FOUND_ROWS
;
join
->
select_options
^=
OPTION_FOUND_ROWS
;
jt
->
table
->
file
->
info
(
HA_STATUS_VARIABLE
);
if
(
table
->
record_pointers
||
join
->
send_records
=
jt
->
table
->
file
->
records
;
(
table
->
io_cache
&&
my_b_inited
(
table
->
io_cache
)))
{
/* Using filesort */
join
->
send_records
=
table
->
found_records
;
}
else
{
table
->
file
->
info
(
HA_STATUS_VARIABLE
);
join
->
send_records
=
table
->
file
->
records
;
}
}
}
else
else
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment