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
ea140d86
Commit
ea140d86
authored
Jul 05, 2010
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
2ecadfc1
3e1a4707
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
9 deletions
+67
-9
mysql-test/r/lowercase_view.result
mysql-test/r/lowercase_view.result
+17
-0
mysql-test/t/lowercase_view.test
mysql-test/t/lowercase_view.test
+22
-0
sql/sql_show.cc
sql/sql_show.cc
+28
-9
No files found.
mysql-test/r/lowercase_view.result
View file @
ea140d86
...
@@ -148,3 +148,20 @@ a
...
@@ -148,3 +148,20 @@ a
DROP VIEW v1;
DROP VIEW v1;
DROP TABLE t1;
DROP TABLE t1;
End of 5.0 tests.
End of 5.0 tests.
#
# Bug #53095: SELECT column_name FROM INFORMATION_SCHEMA.STATISTICS
# returns nothing
#
CREATE TABLE `ttt` (
`f1` char(3) NOT NULL,
PRIMARY KEY (`f1`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
SELECT count(COLUMN_NAME) FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME =
'TTT';
count(COLUMN_NAME)
1
SELECT count(*) FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 'TTT';
count(*)
1
DROP TABLE `ttt`;
End of 5.0 tests.
mysql-test/t/lowercase_view.test
View file @
ea140d86
...
@@ -160,4 +160,26 @@ SELECT * FROM v1;
...
@@ -160,4 +160,26 @@ SELECT * FROM v1;
DROP
VIEW
v1
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
.
--
echo
#
--
echo
# Bug #53095: SELECT column_name FROM INFORMATION_SCHEMA.STATISTICS
--
echo
# returns nothing
--
echo
#
CREATE
TABLE
`ttt`
(
`f1`
char
(
3
)
NOT
NULL
,
PRIMARY
KEY
(
`f1`
)
)
ENGINE
=
myisam
DEFAULT
CHARSET
=
latin1
;
SELECT
count
(
COLUMN_NAME
)
FROM
INFORMATION_SCHEMA
.
STATISTICS
WHERE
TABLE_NAME
=
'TTT'
;
SELECT
count
(
*
)
FROM
INFORMATION_SCHEMA
.
STATISTICS
WHERE
TABLE_NAME
=
'TTT'
;
DROP
TABLE
`ttt`
;
--
echo
End
of
5.0
tests
.
--
echo
End
of
5.0
tests
.
sql/sql_show.cc
View file @
ea140d86
...
@@ -2626,36 +2626,54 @@ bool get_lookup_field_values(THD *thd, COND *cond, TABLE_LIST *tables,
...
@@ -2626,36 +2626,54 @@ bool get_lookup_field_values(THD *thd, COND *cond, TABLE_LIST *tables,
{
{
LEX
*
lex
=
thd
->
lex
;
LEX
*
lex
=
thd
->
lex
;
const
char
*
wild
=
lex
->
wild
?
lex
->
wild
->
ptr
()
:
NullS
;
const
char
*
wild
=
lex
->
wild
?
lex
->
wild
->
ptr
()
:
NullS
;
bool
rc
=
0
;
bzero
((
char
*
)
lookup_field_values
,
sizeof
(
LOOKUP_FIELD_VALUES
));
bzero
((
char
*
)
lookup_field_values
,
sizeof
(
LOOKUP_FIELD_VALUES
));
switch
(
lex
->
sql_command
)
{
switch
(
lex
->
sql_command
)
{
case
SQLCOM_SHOW_DATABASES
:
case
SQLCOM_SHOW_DATABASES
:
if
(
wild
)
if
(
wild
)
{
{
lookup_field_values
->
db_value
.
str
=
(
char
*
)
wild
;
thd
->
make_lex_string
(
&
lookup_field_values
->
db_value
,
lookup_field_values
->
db_value
.
length
=
strlen
(
wild
);
wild
,
strlen
(
wild
),
0
);
lookup_field_values
->
wild_db_value
=
1
;
lookup_field_values
->
wild_db_value
=
1
;
}
}
return
0
;
break
;
case
SQLCOM_SHOW_TABLES
:
case
SQLCOM_SHOW_TABLES
:
case
SQLCOM_SHOW_TABLE_STATUS
:
case
SQLCOM_SHOW_TABLE_STATUS
:
case
SQLCOM_SHOW_TRIGGERS
:
case
SQLCOM_SHOW_TRIGGERS
:
case
SQLCOM_SHOW_EVENTS
:
case
SQLCOM_SHOW_EVENTS
:
lookup_field_values
->
db_value
.
str
=
lex
->
select_lex
.
db
;
thd
->
make_lex_string
(
&
lookup_field_values
->
db_value
,
lookup_field_values
->
db_value
.
length
=
strlen
(
lex
->
select_lex
.
db
);
lex
->
select_lex
.
db
,
strlen
(
lex
->
select_lex
.
db
),
0
);
if
(
wild
)
if
(
wild
)
{
{
lookup_field_values
->
table_value
.
str
=
(
char
*
)
wild
;
thd
->
make_lex_string
(
&
lookup_field_values
->
table_value
,
lookup_field_values
->
table_value
.
length
=
strlen
(
wild
);
wild
,
strlen
(
wild
),
0
);
lookup_field_values
->
wild_table_value
=
1
;
lookup_field_values
->
wild_table_value
=
1
;
}
}
return
0
;
break
;
default:
default:
/*
/*
The "default" is for queries over I_S.
The "default" is for queries over I_S.
All previous cases handle SHOW commands.
All previous cases handle SHOW commands.
*/
*/
return
calc_lookup_values_from_cond
(
thd
,
cond
,
tables
,
lookup_field_values
);
rc
=
calc_lookup_values_from_cond
(
thd
,
cond
,
tables
,
lookup_field_values
);
break
;
}
}
if
(
lower_case_table_names
&&
!
rc
)
{
/*
We can safely do in-place upgrades here since all of the above cases
are allocating a new memory buffer for these strings.
*/
if
(
lookup_field_values
->
db_value
.
str
&&
lookup_field_values
->
db_value
.
str
[
0
])
my_casedn_str
(
system_charset_info
,
lookup_field_values
->
db_value
.
str
);
if
(
lookup_field_values
->
table_value
.
str
&&
lookup_field_values
->
table_value
.
str
[
0
])
my_casedn_str
(
system_charset_info
,
lookup_field_values
->
table_value
.
str
);
}
return
rc
;
}
}
...
@@ -3441,6 +3459,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
...
@@ -3441,6 +3459,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
error
=
0
;
error
=
0
;
goto
err
;
goto
err
;
}
}
DBUG_PRINT
(
"INDEX VALUES"
,(
"db_name='%s', table_name='%s'"
,
DBUG_PRINT
(
"INDEX VALUES"
,(
"db_name='%s', table_name='%s'"
,
STR_OR_NIL
(
lookup_field_vals
.
db_value
.
str
),
STR_OR_NIL
(
lookup_field_vals
.
db_value
.
str
),
STR_OR_NIL
(
lookup_field_vals
.
table_value
.
str
)));
STR_OR_NIL
(
lookup_field_vals
.
table_value
.
str
)));
...
...
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