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
2122ba09
Commit
2122ba09
authored
Jun 21, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1
into rurik.mysql.com:/home/igor/mysql-4.1
parents
9a69ad6e
7506094b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
mysql-test/r/group_by.result
mysql-test/r/group_by.result
+10
-0
mysql-test/t/group_by.test
mysql-test/t/group_by.test
+15
-0
sql/item_buff.cc
sql/item_buff.cc
+2
-2
No files found.
mysql-test/r/group_by.result
View file @
2122ba09
...
@@ -741,3 +741,13 @@ SELECT dt DIV 1 AS f, id FROM t1 GROUP BY f;
...
@@ -741,3 +741,13 @@ SELECT dt DIV 1 AS f, id FROM t1 GROUP BY f;
f id
f id
20050501123000 1
20050501123000 1
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (id varchar(20) NOT NULL);
INSERT INTO t1 VALUES ('trans1'), ('trans2');
CREATE TABLE t2 (id varchar(20) NOT NULL, err_comment blob NOT NULL);
INSERT INTO t2 VALUES ('trans1', 'a problem');
SELECT COUNT(DISTINCT(t1.id)), LEFT(err_comment, 256) AS err_comment
FROM t1 LEFT JOIN t2 ON t1.id=t2.id GROUP BY err_comment;
COUNT(DISTINCT(t1.id)) err_comment
1 NULL
1 a problem
DROP TABLE t1, t2;
mysql-test/t/group_by.test
View file @
2122ba09
...
@@ -565,3 +565,18 @@ INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
...
@@ -565,3 +565,18 @@ INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
SELECT
dt
DIV
1
AS
f
,
id
FROM
t1
GROUP
BY
f
;
SELECT
dt
DIV
1
AS
f
,
id
FROM
t1
GROUP
BY
f
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Test for bug #11295: GROUP BY a BLOB column with COUNT(DISTINCT column1)
# when the BLOB column takes NULL values
#
CREATE
TABLE
t1
(
id
varchar
(
20
)
NOT
NULL
);
INSERT
INTO
t1
VALUES
(
'trans1'
),
(
'trans2'
);
CREATE
TABLE
t2
(
id
varchar
(
20
)
NOT
NULL
,
err_comment
blob
NOT
NULL
);
INSERT
INTO
t2
VALUES
(
'trans1'
,
'a problem'
);
SELECT
COUNT
(
DISTINCT
(
t1
.
id
)),
LEFT
(
err_comment
,
256
)
AS
err_comment
FROM
t1
LEFT
JOIN
t2
ON
t1
.
id
=
t2
.
id
GROUP
BY
err_comment
;
DROP
TABLE
t1
,
t2
;
sql/item_buff.cc
View file @
2122ba09
...
@@ -51,7 +51,7 @@ bool Item_str_buff::cmp(void)
...
@@ -51,7 +51,7 @@ bool Item_str_buff::cmp(void)
String
*
res
;
String
*
res
;
bool
tmp
;
bool
tmp
;
res
=
item
->
val_str
(
&
tmp_value
);
if
((
res
=
item
->
val_str
(
&
tmp_value
)))
res
->
length
(
min
(
res
->
length
(),
value
.
alloced_length
()));
res
->
length
(
min
(
res
->
length
(),
value
.
alloced_length
()));
if
(
null_value
!=
item
->
null_value
)
if
(
null_value
!=
item
->
null_value
)
{
{
...
...
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