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
7a896f36
Commit
7a896f36
authored
Dec 16, 2002
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge sinisa@work.mysql.com:/home/bk/mysql
into sinisa.nasamreza.org:/mnt/work/mysql
parents
0c8582b3
e003d42e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
2 deletions
+14
-2
mysql-test/r/case.result
mysql-test/r/case.result
+4
-0
mysql-test/t/case.test
mysql-test/t/case.test
+5
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+2
-0
sql/sql_db.cc
sql/sql_db.cc
+3
-2
No files found.
mysql-test/r/case.result
View file @
7a896f36
...
@@ -40,3 +40,7 @@ fcase count(*)
...
@@ -40,3 +40,7 @@ fcase count(*)
nothing 2
nothing 2
one 1
one 1
two 1
two 1
color
orange
yellow
green
mysql-test/t/case.test
View file @
7a896f36
...
@@ -30,3 +30,8 @@ insert into t1 values(1),(2),(3),(4);
...
@@ -30,3 +30,8 @@ insert into t1 values(1),(2),(3),(4);
select
case
a
when
1
then
2
when
2
then
3
else
0
end
as
fcase
,
count
(
*
)
from
t1
group
by
fcase
;
select
case
a
when
1
then
2
when
2
then
3
else
0
end
as
fcase
,
count
(
*
)
from
t1
group
by
fcase
;
select
case
a
when
1
then
"one"
when
2
then
"two"
else
"nothing"
end
as
fcase
,
count
(
*
)
from
t1
group
by
fcase
;
select
case
a
when
1
then
"one"
when
2
then
"two"
else
"nothing"
end
as
fcase
,
count
(
*
)
from
t1
group
by
fcase
;
drop
table
t1
;
drop
table
t1
;
drop
table
if
exists
t
;
create
table
t1
(
row
int
not
null
,
col
int
not
null
,
val
varchar
(
255
)
not
null
);
insert
into
t1
values
(
1
,
1
,
'orange'
),(
1
,
2
,
'large'
),(
2
,
1
,
'yellow'
),(
2
,
2
,
'medium'
),(
3
,
1
,
'green'
),(
3
,
2
,
'small'
);
select
max
(
case
col
when
1
then
val
else
null
end
)
as
color
from
t1
group
by
row
;
drop
table
if
exists
t
;
sql/item_cmpfunc.cc
View file @
7a896f36
...
@@ -687,6 +687,8 @@ String *Item_func_case::val_str(String *str)
...
@@ -687,6 +687,8 @@ String *Item_func_case::val_str(String *str)
}
}
if
(
!
(
res
=
item
->
val_str
(
str
)))
if
(
!
(
res
=
item
->
val_str
(
str
)))
null_value
=
1
;
null_value
=
1
;
else
null_value
=
item
->
null_value
;
return
res
;
return
res
;
}
}
...
...
sql/sql_db.cc
View file @
7a896f36
...
@@ -323,6 +323,9 @@ bool mysql_change_db(THD *thd,const char *name)
...
@@ -323,6 +323,9 @@ bool mysql_change_db(THD *thd,const char *name)
uint
db_access
;
uint
db_access
;
DBUG_ENTER
(
"mysql_change_db"
);
DBUG_ENTER
(
"mysql_change_db"
);
if
(
lower_case_table_names
)
casedn_str
(
dbname
);
if
(
!
dbname
||
!
(
length
=
strip_sp
(
dbname
)))
if
(
!
dbname
||
!
(
length
=
strip_sp
(
dbname
)))
{
{
x_free
(
dbname
);
/* purecov: inspected */
x_free
(
dbname
);
/* purecov: inspected */
...
@@ -368,8 +371,6 @@ bool mysql_change_db(THD *thd,const char *name)
...
@@ -368,8 +371,6 @@ bool mysql_change_db(THD *thd,const char *name)
}
}
send_ok
(
&
thd
->
net
);
send_ok
(
&
thd
->
net
);
x_free
(
thd
->
db
);
x_free
(
thd
->
db
);
if
(
lower_case_table_names
)
casedn_str
(
dbname
);
thd
->
db
=
dbname
;
thd
->
db
=
dbname
;
thd
->
db_access
=
db_access
;
thd
->
db_access
=
db_access
;
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
...
...
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