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
c6325cb0
Commit
c6325cb0
authored
Mar 09, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/Users/kent/mysql/bk/mysql-5.0-new
parents
e345f28b
c258358f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
5 deletions
+52
-5
mysql-test/r/distinct.result
mysql-test/r/distinct.result
+21
-0
mysql-test/t/distinct.test
mysql-test/t/distinct.test
+24
-0
sql/item_sum.cc
sql/item_sum.cc
+3
-3
sql/sql_lex.cc
sql/sql_lex.cc
+2
-1
sql/sql_show.cc
sql/sql_show.cc
+2
-1
No files found.
mysql-test/r/distinct.result
View file @
c6325cb0
...
...
@@ -512,3 +512,24 @@ id IFNULL(dsc, '-')
2 line number two
3 line number three
drop table t1;
CREATE TABLE t1 (
ID int(11) NOT NULL auto_increment,
x varchar(20) default NULL,
y decimal(10,0) default NULL,
PRIMARY KEY (ID),
KEY (y)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES
(1,'ba','-1'),
(2,'ba','1150'),
(306,'ba','-1'),
(307,'ba','1150'),
(611,'ba','-1'),
(612,'ba','1150');
select count(distinct x,y) from t1;
count(distinct x,y)
2
select count(distinct concat(x,y)) from t1;
count(distinct concat(x,y))
2
drop table t1;
mysql-test/t/distinct.test
View file @
c6325cb0
...
...
@@ -358,3 +358,27 @@ select distinct id, IFNULL(dsc, '-') from t1;
drop
table
t1
;
# End of 4.1 tests
#
# Bug #15745 ( COUNT(DISTINCT CONCAT(x,y)) returns wrong result)
#
CREATE
TABLE
t1
(
ID
int
(
11
)
NOT
NULL
auto_increment
,
x
varchar
(
20
)
default
NULL
,
y
decimal
(
10
,
0
)
default
NULL
,
PRIMARY
KEY
(
ID
),
KEY
(
y
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
INSERT
INTO
t1
VALUES
(
1
,
'ba'
,
'-1'
),
(
2
,
'ba'
,
'1150'
),
(
306
,
'ba'
,
'-1'
),
(
307
,
'ba'
,
'1150'
),
(
611
,
'ba'
,
'-1'
),
(
612
,
'ba'
,
'1150'
);
select
count
(
distinct
x
,
y
)
from
t1
;
select
count
(
distinct
concat
(
x
,
y
))
from
t1
;
drop
table
t1
;
sql/item_sum.cc
View file @
c6325cb0
...
...
@@ -2541,9 +2541,9 @@ bool Item_sum_count_distinct::setup(THD *thd)
Field
*
f
=
*
field
;
enum
enum_field_types
type
=
f
->
type
();
tree_key_length
+=
f
->
pack_length
();
if
(
!
f
->
binary
()
&&
(
type
==
MYSQL_TYPE_STRING
||
type
==
MYSQL_TYPE_VAR
_STRING
||
type
==
MYSQL_TYPE_VAR
CHAR
))
if
(
(
type
==
MYSQL_TYPE_VARCHAR
)
||
!
f
->
binary
()
&&
(
type
==
MYSQL_TYPE
_STRING
||
type
==
MYSQL_TYPE_VAR
_STRING
))
{
all_binary
=
FALSE
;
break
;
...
...
sql/sql_lex.cc
View file @
c6325cb0
...
...
@@ -223,7 +223,7 @@ static int find_keyword(LEX *lex, uint len, bool function)
SYNOPSIS
is_keyword()
name checked name
name checked name
(must not be empty)
len length of checked name
RETURN VALUES
...
...
@@ -233,6 +233,7 @@ static int find_keyword(LEX *lex, uint len, bool function)
bool
is_keyword
(
const
char
*
name
,
uint
len
)
{
DBUG_ASSERT
(
len
!=
0
);
return
get_hash_symbol
(
name
,
len
,
0
)
!=
0
;
}
...
...
sql/sql_show.cc
View file @
c6325cb0
...
...
@@ -713,7 +713,8 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
int
get_quote_char_for_identifier
(
THD
*
thd
,
const
char
*
name
,
uint
length
)
{
if
(
!
is_keyword
(
name
,
length
)
&&
if
(
!
length
||
!
is_keyword
(
name
,
length
)
&&
!
require_quotes
(
name
,
length
)
&&
!
(
thd
->
options
&
OPTION_QUOTE_SHOW_CREATE
))
return
EOF
;
...
...
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