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
d289accb
Commit
d289accb
authored
Jul 23, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fuller implementation of lower case table names.
Bug record #828
parent
b3021da2
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
5 deletions
+25
-5
mysql-test/r/lowercase_table.result
mysql-test/r/lowercase_table.result
+2
-1
mysql-test/t/lowercase_table.test
mysql-test/t/lowercase_table.test
+0
-1
sql/mysql_priv.h
sql/mysql_priv.h
+6
-0
sql/sql_class.h
sql/sql_class.h
+9
-3
sql/sql_parse.cc
sql/sql_parse.cc
+2
-0
sql/sql_table.cc
sql/sql_table.cc
+2
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+4
-0
No files found.
mysql-test/r/lowercase_table.result
View file @
d289accb
...
...
@@ -21,7 +21,8 @@ select count(*) from t1;
count(*)
0
select count(T1.a) from t1;
Unknown table 'T1' in field list
count(T1.a)
0
select count(bags.a) from t1 as Bags;
Unknown table 'bags' in field list
drop table t1;
mysql-test/t/lowercase_table.test
View file @
d289accb
...
...
@@ -18,7 +18,6 @@ drop table t3;
create
table
t1
(
a
int
);
select
count
(
*
)
from
T1
;
select
count
(
*
)
from
t1
;
--
error
1109
select
count
(
T1
.
a
)
from
t1
;
--
error
1109
select
count
(
bags
.
a
)
from
t1
as
Bags
;
...
...
sql/mysql_priv.h
View file @
d289accb
...
...
@@ -862,3 +862,9 @@ inline void mark_as_null_row(TABLE *table)
table
->
status
|=
STATUS_NULL_ROW
;
bfill
(
table
->
null_flags
,
table
->
null_bytes
,
255
);
}
inline
void
table_case_convert
(
char
*
name
,
uint
length
)
{
if
(
lower_case_table_names
)
casedn
(
name
,
length
);
}
sql/sql_class.h
View file @
d289accb
...
...
@@ -33,7 +33,7 @@ enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_IGNORE };
enum
enum_log_type
{
LOG_CLOSED
,
LOG_TO_BE_OPENED
,
LOG_NORMAL
,
LOG_NEW
,
LOG_BIN
};
enum
enum_delay_key_write
{
DELAY_KEY_WRITE_NONE
,
DELAY_KEY_WRITE_ON
,
DELAY_KEY_WRITE_ALL
};
extern
inline
void
table_case_convert
(
char
*
name
,
uint
length
);
/* log info errors */
#define LOG_INFO_EOF -1
#define LOG_INFO_IO -2
...
...
@@ -758,7 +758,6 @@ typedef struct st_sort_buffer {
SORT_FIELD
*
sortorder
;
}
SORT_BUFFER
;
/* Structure for db & table in sql_yacc */
class
Table_ident
:
public
Sql_alloc
{
...
...
@@ -772,8 +771,15 @@ class Table_ident :public Sql_alloc {
db
.
str
=
0
;
else
db
=
db_arg
;
if
(
db
.
str
)
table_case_convert
(
db
.
str
,
db
.
length
);
table_case_convert
(
table
.
str
,
table
.
length
);
}
inline
Table_ident
(
LEX_STRING
table_arg
)
:
table
(
table_arg
)
{
db
.
str
=
0
;
table_case_convert
(
table
.
str
,
table
.
length
);
}
inline
Table_ident
(
LEX_STRING
table_arg
)
:
table
(
table_arg
)
{
db
.
str
=
0
;}
inline
void
change_db
(
char
*
db_name
)
{
db
.
str
=
db_name
;
db
.
length
=
(
uint
)
strlen
(
db_name
);
}
};
...
...
sql/sql_parse.cc
View file @
d289accb
...
...
@@ -3385,8 +3385,10 @@ TABLE_LIST *add_table_to_list(Table_ident *table, LEX_STRING *alias,
}
ptr
->
alias
=
alias_str
;
#ifdef TO_BE_DELETED
if
(
lower_case_table_names
)
casedn_str
(
table
->
table
.
str
);
#endif
ptr
->
real_name
=
table
->
table
.
str
;
ptr
->
real_name_length
=
table
->
table
.
length
;
ptr
->
lock_type
=
lock_type
;
...
...
sql/sql_table.cc
View file @
d289accb
...
...
@@ -1459,8 +1459,10 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
{
strmov
(
new_name_buff
,
new_name
);
fn_same
(
new_name_buff
,
table_name
,
3
);
#ifdef TO_BE_DELETED
if
(
lower_case_table_names
)
casedn_str
(
new_name
);
#endif
if
((
lower_case_table_names
&&
!
my_strcasecmp
(
new_name_buff
,
table_name
))
||
(
!
lower_case_table_names
&&
...
...
sql/sql_yacc.yy
View file @
d289accb
...
...
@@ -3221,16 +3221,20 @@ simple_ident:
| ident '.' ident
{
SELECT_LEX *sel=Select;
table_case_convert($1.str, $1.length);
$$ = !sel->create_refs || sel->in_sum_expr > 0 ? (Item*) new Item_field(NullS,$1.str,$3.str) : (Item*) new Item_ref(NullS,$1.str,$3.str);
}
| '.' ident '.' ident
{
SELECT_LEX *sel=Select;
table_case_convert($2.str,$2.length);
$$ = !sel->create_refs || sel->in_sum_expr > 0 ? (Item*) new Item_field(NullS,$2.str,$4.str) : (Item*) new Item_ref(NullS,$2.str,$4.str);
}
| ident '.' ident '.' ident
{
SELECT_LEX *sel=Select;
table_case_convert($1.str,$1.length);
table_case_convert($3.str,$3.length);
$$ = !sel->create_refs || sel->in_sum_expr > 0 ? (Item*) new Item_field((current_thd->client_capabilities & CLIENT_NO_SCHEMA ? NullS :$1.str),$3.str,$5.str) : (Item*) new Item_ref((current_thd->client_capabilities & CLIENT_NO_SCHEMA ? NullS :$1.str),$3.str,$5.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