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
1fc3a87b
Commit
1fc3a87b
authored
Jul 05, 2010
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
b8671789
dd6d026f
Changes
3
Hide 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 @
1fc3a87b
...
...
@@ -148,3 +148,20 @@ a
DROP VIEW v1;
DROP TABLE t1;
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 @
1fc3a87b
...
...
@@ -160,4 +160,26 @@ SELECT * FROM v1;
DROP
VIEW
v1
;
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
.
sql/sql_show.cc
View file @
1fc3a87b
...
...
@@ -2626,36 +2626,54 @@ bool get_lookup_field_values(THD *thd, COND *cond, TABLE_LIST *tables,
{
LEX
*
lex
=
thd
->
lex
;
const
char
*
wild
=
lex
->
wild
?
lex
->
wild
->
ptr
()
:
NullS
;
bool
rc
=
0
;
bzero
((
char
*
)
lookup_field_values
,
sizeof
(
LOOKUP_FIELD_VALUES
));
switch
(
lex
->
sql_command
)
{
case
SQLCOM_SHOW_DATABASES
:
if
(
wild
)
{
lookup_field_values
->
db_value
.
str
=
(
char
*
)
wild
;
lookup_field_values
->
db_value
.
length
=
strlen
(
wild
);
thd
->
make_lex_string
(
&
lookup_field_values
->
db_value
,
wild
,
strlen
(
wild
),
0
);
lookup_field_values
->
wild_db_value
=
1
;
}
return
0
;
break
;
case
SQLCOM_SHOW_TABLES
:
case
SQLCOM_SHOW_TABLE_STATUS
:
case
SQLCOM_SHOW_TRIGGERS
:
case
SQLCOM_SHOW_EVENTS
:
lookup_field_values
->
db_value
.
str
=
lex
->
select_lex
.
db
;
lookup_field_values
->
db_value
.
length
=
strlen
(
lex
->
select_lex
.
db
);
thd
->
make_lex_string
(
&
lookup_field_values
->
db_value
,
lex
->
select_lex
.
db
,
strlen
(
lex
->
select_lex
.
db
),
0
);
if
(
wild
)
{
lookup_field_values
->
table_value
.
str
=
(
char
*
)
wild
;
lookup_field_values
->
table_value
.
length
=
strlen
(
wild
);
thd
->
make_lex_string
(
&
lookup_field_values
->
table_value
,
wild
,
strlen
(
wild
),
0
);
lookup_field_values
->
wild_table_value
=
1
;
}
return
0
;
break
;
default:
/*
The "default" is for queries over I_S.
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)
error
=
0
;
goto
err
;
}
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
.
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