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
1e3df575
Commit
1e3df575
authored
Apr 21, 2001
by
monty@donna.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed probelm with count(*) and normal functions when no matchin rows.
Changed 'lib' to 'master-data' Fix for slow slaves
parent
0f37b124
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
48 additions
and
10 deletions
+48
-10
Docs/manual.texi
Docs/manual.texi
+3
-0
include/mysql.h
include/mysql.h
+8
-0
libmysql/libmysql.c
libmysql/libmysql.c
+1
-1
mysql-test/Makefile.am
mysql-test/Makefile.am
+1
-1
mysql-test/include/master-slave.inc
mysql-test/include/master-slave.inc
+2
-0
mysql-test/install_test_db.sh
mysql-test/install_test_db.sh
+2
-2
mysql-test/mysql-test-run.sh
mysql-test/mysql-test-run.sh
+4
-2
mysql-test/r/group_by.result
mysql-test/r/group_by.result
+4
-0
mysql-test/t/group_by.test
mysql-test/t/group_by.test
+12
-0
mysql-test/t/rpl000018-master.sh
mysql-test/t/rpl000018-master.sh
+3
-3
sql/sql_select.cc
sql/sql_select.cc
+8
-1
No files found.
Docs/manual.texi
View file @
1e3df575
...
@@ -43943,6 +43943,9 @@ not yet 100% confident in this code.
...
@@ -43943,6 +43943,9 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.38
@appendixsubsec Changes in release 3.23.38
@itemize @bullet
@itemize @bullet
@item
@item
Fixed problems with function returning empty string when using
together with a group functions and a @code{WHERE} that didn't match any rows.
@item
New program @code{mysqlcheck}.
New program @code{mysqlcheck}.
@item
@item
Added database name to output for admin commands like @code{CHECK},
Added database name to output for admin commands like @code{CHECK},
include/mysql.h
View file @
1e3df575
...
@@ -20,6 +20,14 @@
...
@@ -20,6 +20,14 @@
#ifndef _mysql_h
#ifndef _mysql_h
#define _mysql_h
#define _mysql_h
#ifdef __CYGWIN__
/* CYGWIN implements a UNIX API */
#undef WIN
#undef _WIN
#undef _WIN32
#undef _WIN64
#undef __WIN__
#endif
#ifndef MYSQL_SERVER
#ifndef MYSQL_SERVER
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
...
libmysql/libmysql.c
View file @
1e3df575
...
@@ -16,11 +16,11 @@
...
@@ -16,11 +16,11 @@
MA 02111-1307, USA */
MA 02111-1307, USA */
#define DONT_USE_RAID
#define DONT_USE_RAID
#include <global.h>
#if defined(__WIN__) || defined(_WIN32) || defined(_WIN64)
#if defined(__WIN__) || defined(_WIN32) || defined(_WIN64)
#include <winsock.h>
#include <winsock.h>
#include <odbcinst.h>
#include <odbcinst.h>
#endif
#endif
#include <global.h>
#include <my_sys.h>
#include <my_sys.h>
#include <mysys_err.h>
#include <mysys_err.h>
#include <m_string.h>
#include <m_string.h>
...
...
mysql-test/Makefile.am
View file @
1e3df575
...
@@ -30,7 +30,7 @@ dist-hook:
...
@@ -30,7 +30,7 @@ dist-hook:
$(INSTALL_DATA)
$(srcdir)
/t/
*
.test
$(srcdir)
/t/
*
.opt
$(srcdir)
/t/
*
.sh
$(distdir)
/t
$(INSTALL_DATA)
$(srcdir)
/t/
*
.test
$(srcdir)
/t/
*
.opt
$(srcdir)
/t/
*
.sh
$(distdir)
/t
$(INSTALL_DATA)
$(srcdir)
/include/
*
.inc
$(distdir)
/include
$(INSTALL_DATA)
$(srcdir)
/include/
*
.inc
$(distdir)
/include
$(INSTALL_DATA)
$(srcdir)
/r/
*
.result
$(srcdir)
/r/
*
.require
$(distdir)
/r
$(INSTALL_DATA)
$(srcdir)
/r/
*
.result
$(srcdir)
/r/
*
.require
$(distdir)
/r
$(INSTALL_DATA)
$(srcdir)
/std_data/
*
.dat
$(distdir)
/std_data
$(INSTALL_DATA)
$(srcdir)
/std_data/
*
.dat
$(
srcdir)
/std_data/
*
.001
$(
distdir)
/std_data
install-data-local
:
install-data-local
:
$(mkinstalldirs)
\
$(mkinstalldirs)
\
...
...
mysql-test/include/master-slave.inc
View file @
1e3df575
...
@@ -9,5 +9,7 @@ connection master;
...
@@ -9,5 +9,7 @@ connection master;
reset
master
;
reset
master
;
connection
slave
;
connection
slave
;
reset
slave
;
reset
slave
;
# Clean up old test tables
drop
table
if
exists
t1
,
t2
,
t3
,
t4
,
t5
,
t6
,
t7
,
t8
,
t9
;
slave
start
;
slave
start
;
@
r
/
slave
-
running
.
result
show
status
like
'Slave_running'
;
@
r
/
slave
-
running
.
result
show
status
like
'Slave_running'
;
mysql-test/install_test_db.sh
View file @
1e3df575
...
@@ -25,8 +25,8 @@ then
...
@@ -25,8 +25,8 @@ then
data
=
var/slave-data
data
=
var/slave-data
ldata
=
$fix_bin
/var/slave-data
ldata
=
$fix_bin
/var/slave-data
else
else
data
=
var/
lib
data
=
var/
master-data
ldata
=
$fix_bin
/var/
lib
ldata
=
$fix_bin
/var/
master-data
fi
fi
mdata
=
$data
/mysql
mdata
=
$data
/mysql
...
...
mysql-test/mysql-test-run.sh
View file @
1e3df575
...
@@ -188,7 +188,7 @@ done
...
@@ -188,7 +188,7 @@ done
#--
#--
MYRUN_DIR
=
$MYSQL_TEST_DIR
/var/run
MYRUN_DIR
=
$MYSQL_TEST_DIR
/var/run
MASTER_MYDDIR
=
"
$MYSQL_TEST_DIR
/var/
lib
"
MASTER_MYDDIR
=
"
$MYSQL_TEST_DIR
/var/
master-data
"
MASTER_MYSOCK
=
"
$MYSQL_TMP_DIR
/mysql-master.sock"
MASTER_MYSOCK
=
"
$MYSQL_TMP_DIR
/mysql-master.sock"
MASTER_MYPID
=
"
$MYRUN_DIR
/mysqld.pid"
MASTER_MYPID
=
"
$MYRUN_DIR
/mysqld.pid"
MASTER_MYLOG
=
"
$MYSQL_TEST_DIR
/var/log/mysqld.log"
MASTER_MYLOG
=
"
$MYSQL_TEST_DIR
/var/log/mysqld.log"
...
@@ -288,6 +288,8 @@ prompt_user ()
...
@@ -288,6 +288,8 @@ prompt_user ()
read
unused
read
unused
}
}
# We can't use diff -u as this isn't portable
show_failed_diff
()
show_failed_diff
()
{
{
reject_file
=
r/
$1
.reject
reject_file
=
r/
$1
.reject
...
@@ -296,7 +298,7 @@ show_failed_diff ()
...
@@ -296,7 +298,7 @@ show_failed_diff ()
then
then
echo
"Below are the diffs between actual and expected results:"
echo
"Below are the diffs between actual and expected results:"
echo
"-------------------------------------------------------"
echo
"-------------------------------------------------------"
$DIFF
-
u
$result_file
$reject_file
$DIFF
-
c
$result_file
$reject_file
echo
"-------------------------------------------------------"
echo
"-------------------------------------------------------"
echo
"Please e-mail the above, along with the output of mysqlbug"
echo
"Please e-mail the above, along with the output of mysqlbug"
echo
"and any other relevant info to bugs@lists.mysql.com"
echo
"and any other relevant info to bugs@lists.mysql.com"
...
...
mysql-test/r/group_by.result
View file @
1e3df575
...
@@ -30,3 +30,7 @@ Documentation 0
...
@@ -30,3 +30,7 @@ Documentation 0
Host communication 0
Host communication 0
kkkkkkkkkkk lllllllllll 3
kkkkkkkkkkk lllllllllll 3
Test Procedures 0
Test Procedures 0
1+1 a count(*)
2 a 0
1+1 a count(*)
2 a 0
mysql-test/t/group_by.test
View file @
1e3df575
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
# Test of group (Failed for Lars Hoss <lh@pbm.de>)
# Test of group (Failed for Lars Hoss <lh@pbm.de>)
#
#
drop
table
if
exists
t1
,
t2
;
CREATE
TABLE
t1
(
CREATE
TABLE
t1
(
spID
int
(
10
)
unsigned
,
spID
int
(
10
)
unsigned
,
userID
int
(
10
)
unsigned
,
userID
int
(
10
)
unsigned
,
...
@@ -208,3 +209,14 @@ select value,description,bug_id from t2 left join t1 on t2.program=t1.product an
...
@@ -208,3 +209,14 @@ select value,description,bug_id from t2 left join t1 on t2.program=t1.product an
select
value
,
description
,
COUNT
(
bug_id
)
from
t2
left
join
t1
on
t2
.
program
=
t1
.
product
and
t2
.
value
=
t1
.
component
where
program
=
"AAAAA"
group
by
value
;
select
value
,
description
,
COUNT
(
bug_id
)
from
t2
left
join
t1
on
t2
.
program
=
t1
.
product
and
t2
.
value
=
t1
.
component
where
program
=
"AAAAA"
group
by
value
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# Problem with functions and group functions when no matching rows
#
create
table
t1
(
foo
int
);
insert
into
t1
values
(
1
);
select
1
+
1
,
"a"
,
count
(
*
)
from
t1
where
foo
in
(
2
);
insert
into
t1
values
(
1
);
select
1
+
1
,
"a"
,
count
(
*
)
from
t1
where
foo
in
(
2
);
drop
table
t1
;
mysql-test/t/rpl000018-master.sh
View file @
1e3df575
rm
-f
$MYSQL_TEST_DIR
/var/
lib
/master-bin.
*
rm
-f
$MYSQL_TEST_DIR
/var/
master-data
/master-bin.
*
cp
$MYSQL_TEST_DIR
/std_data/master-bin.001
$MYSQL_TEST_DIR
/var/
lib
/
cp
$MYSQL_TEST_DIR
/std_data/master-bin.001
$MYSQL_TEST_DIR
/var/
master-data
/
echo
./master-bin.001
>
$MYSQL_TEST_DIR
/var/
lib
/master-bin.index
echo
./master-bin.001
>
$MYSQL_TEST_DIR
/var/
master-data
/master-bin.index
sql/sql_select.cc
View file @
1e3df575
...
@@ -4643,7 +4643,11 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
...
@@ -4643,7 +4643,11 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
else
else
{
{
if
(
!
join
->
first_record
)
if
(
!
join
->
first_record
)
{
/* No matching rows for group function */
clear_tables
(
join
);
clear_tables
(
join
);
copy_fields
(
&
join
->
tmp_table_param
);
}
if
(
join
->
having
&&
join
->
having
->
val_int
()
==
0
)
if
(
join
->
having
&&
join
->
having
->
val_int
()
==
0
)
error
=
-
1
;
// Didn't satisfy having
error
=
-
1
;
// Didn't satisfy having
else
else
...
@@ -4875,7 +4879,11 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
...
@@ -4875,7 +4879,11 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
if
(
idx
<
(
int
)
join
->
send_group_parts
)
if
(
idx
<
(
int
)
join
->
send_group_parts
)
{
{
if
(
!
join
->
first_record
)
if
(
!
join
->
first_record
)
{
/* No matching rows for group function */
clear_tables
(
join
);
clear_tables
(
join
);
copy_fields
(
&
join
->
tmp_table_param
);
}
copy_sum_funcs
(
join
->
sum_funcs
);
copy_sum_funcs
(
join
->
sum_funcs
);
if
(
!
join
->
having
||
join
->
having
->
val_int
())
if
(
!
join
->
having
||
join
->
having
->
val_int
())
{
{
...
@@ -4899,7 +4907,6 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
...
@@ -4899,7 +4907,6 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
}
}
if
(
idx
<
(
int
)
join
->
send_group_parts
)
if
(
idx
<
(
int
)
join
->
send_group_parts
)
{
{
copy_fields
(
&
join
->
tmp_table_param
);
copy_funcs
(
join
->
tmp_table_param
.
funcs
);
copy_funcs
(
join
->
tmp_table_param
.
funcs
);
init_sum_functions
(
join
->
sum_funcs
);
init_sum_functions
(
join
->
sum_funcs
);
if
(
join
->
procedure
)
if
(
join
->
procedure
)
...
...
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