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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c71f6995
Commit
c71f6995
authored
Apr 16, 2009
by
Patrick Crews
Browse files
Options
Browse Files
Download
Plain Diff
merge 5.0-> 5.1
parents
fc35ded3
2c1add4b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
27 deletions
+17
-27
mysql-test/r/count_distinct3.result
mysql-test/r/count_distinct3.result
+3
-2
mysql-test/t/count_distinct3.test
mysql-test/t/count_distinct3.test
+14
-25
No files found.
mysql-test/r/count_distinct3.result
View file @
c71f6995
...
@@ -2,7 +2,8 @@ DROP TABLE IF EXISTS t1, t2;
...
@@ -2,7 +2,8 @@ DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (id INTEGER, grp TINYINT, id_rev INTEGER);
CREATE TABLE t1 (id INTEGER, grp TINYINT, id_rev INTEGER);
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FROM t1;
COUNT(*)
COUNT(*)
4
18
1000
4
20
1000
SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
# Begin cleanup
SET session myisam_sort_buffer_size = @orig_myisam_sort_buffer_size;
DROP TABLE t1;
DROP TABLE t1;
set @@read_buffer_size=default;
mysql-test/t/count_distinct3.test
View file @
c71f6995
#
#
Bug #958 a big table without indices and select with group by doesnt work
# this is a test for error 1032 in count(distinct) + group by, introduced in
# this is a test for error 1032 in count(distinct) + group by, introduced in
# mysql-4.1
# mysql-4.1
#
#
...
@@ -21,27 +21,16 @@ while ($1)
...
@@ -21,27 +21,16 @@ while ($1)
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
VALUES
(
@
id
,
@
grp
,
@
id_rev
);
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
VALUES
(
@
id
,
@
grp
,
@
id_rev
);
dec
$
1
;
dec
$
1
;
}
}
set
@@
read_buffer_size
=
2
*
1024
*
1024
;
CREATE
TABLE
t2
SELECT
*
FROM
t1
;
# We increase the size of t1 here.
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t2
;
SET
@
orig_myisam_sort_buffer_size
=
@@
session
.
myisam_sort_buffer_size
;
INSERT
INTO
t2
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t1
;
SET
session
myisam_sort_buffer_size
=
20000000
;
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t2
;
INSERT
INTO
t1
INSERT
INTO
t2
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t1
;
SELECT
A
.
id
,
A
.
grp
,
A
.
id_rev
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t2
;
FROM
INSERT
INTO
t2
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t1
;
t1
A
,
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t2
;
(
SELECT
*
FROM
t1
B
LIMIT
100
)
B
,
INSERT
INTO
t2
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t1
;
(
SELECT
*
FROM
t1
Z
LIMIT
42
)
Z
;
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t2
;
INSERT
INTO
t2
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t1
;
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t2
;
INSERT
INTO
t2
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t1
;
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t2
;
INSERT
INTO
t2
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t1
;
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t2
;
INSERT
INTO
t2
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t1
;
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t2
;
INSERT
INTO
t2
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t1
;
DROP
TABLE
t2
;
--
enable_query_log
--
enable_query_log
SELECT
COUNT
(
*
)
FROM
t1
;
SELECT
COUNT
(
*
)
FROM
t1
;
...
@@ -49,12 +38,12 @@ SELECT COUNT(*) FROM t1;
...
@@ -49,12 +38,12 @@ SELECT COUNT(*) FROM t1;
# As t1 contains random numbers, results are different from test to test.
# As t1 contains random numbers, results are different from test to test.
# That's okay, because we test only that select doesn't yield an
# That's okay, because we test only that select doesn't yield an
# error. Note, that --disable_result_log doesn't suppress error output.
# error. Note, that --disable_result_log doesn't suppress error output.
--
disable_result_log
--
disable_result_log
SELECT
COUNT
(
DISTINCT
id
)
FROM
t1
GROUP
BY
grp
;
SELECT
COUNT
(
DISTINCT
id
)
FROM
t1
GROUP
BY
grp
;
--
enable_result_log
--
enable_result_log
DROP
TABLE
t1
;
set
@@
read_buffer_size
=
default
;
--
echo
# Begin cleanup
SET
session
myisam_sort_buffer_size
=
@
orig_myisam_sort_buffer_size
;
DROP
TABLE
t1
;
# End of 4.1 tests
# End of 4.1 tests
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