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
5e04e237
Commit
5e04e237
authored
Aug 29, 2003
by
monty@narttu.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into narttu.mysql.fi:/my/mysql-4.0
parents
289ffc97
27e331c3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
37 deletions
+24
-37
mysql-test/r/lowercase_table.result
mysql-test/r/lowercase_table.result
+9
-2
mysql-test/t/lowercase_table.test
mysql-test/t/lowercase_table.test
+5
-0
sql/sql_class.cc
sql/sql_class.cc
+0
-23
sql/sql_class.h
sql/sql_class.h
+9
-2
sql/sql_parse.cc
sql/sql_parse.cc
+1
-4
sql/sql_table.cc
sql/sql_table.cc
+0
-2
sql/sql_yacc.yy
sql/sql_yacc.yy
+0
-4
No files found.
mysql-test/r/lowercase_table.result
View file @
5e04e237
...
...
@@ -6,6 +6,14 @@ id Word
1 a
2 b
3 c
SELECT T1.id from T1 LIMIT 1;
id
1
SELECT T2.id from t1 as T2 LIMIT 1;
id
1
SELECT T2.id from t1 as t2 LIMIT 1;
Unknown table 'T2' in field list
RENAME TABLE T1 TO T2;
ALTER TABLE T2 ADD new_col int not null;
ALTER TABLE T2 RENAME T3;
...
...
@@ -21,8 +29,7 @@ select count(*) from t1;
count(*)
0
select count(T1.a) from t1;
count(T1.a)
0
Unknown table 'T1' in field list
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 @
5e04e237
...
...
@@ -6,6 +6,10 @@ drop table if exists t1,t2,t3;
create
table
T1
(
id
int
primary
key
,
Word
varchar
(
40
)
not
null
,
Index
(
Word
));
INSERT
INTO
T1
VALUES
(
1
,
'a'
),
(
2
,
'b'
),
(
3
,
'c'
);
SELECT
*
FROM
t1
;
SELECT
T1
.
id
from
T1
LIMIT
1
;
SELECT
T2
.
id
from
t1
as
T2
LIMIT
1
;
--
error
1109
SELECT
T2
.
id
from
t1
as
t2
LIMIT
1
;
RENAME
TABLE
T1
TO
T2
;
ALTER
TABLE
T2
ADD
new_col
int
not
null
;
ALTER
TABLE
T2
RENAME
T3
;
...
...
@@ -18,6 +22,7 @@ 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/sql_class.cc
View file @
5e04e237
...
...
@@ -430,29 +430,6 @@ void THD::close_active_vio()
}
#endif
/*****************************************************************************
Table Ident
****************************************************************************/
Table_ident
::
Table_ident
(
LEX_STRING
db_arg
,
LEX_STRING
table_arg
,
bool
force
)
:
table
(
table_arg
)
{
if
(
!
force
&&
(
current_thd
->
client_capabilities
&
CLIENT_NO_SCHEMA
))
db
.
str
=
0
;
else
db
=
db_arg
;
if
(
db
.
str
)
table_case_convert
(
db
.
str
,
db
.
length
);
table_case_convert
(
table
.
str
,
table
.
length
);
}
Table_ident
::
Table_ident
(
LEX_STRING
table_arg
)
:
table
(
table_arg
)
{
db
.
str
=
0
;
table_case_convert
(
table
.
str
,
table
.
length
);
}
/*****************************************************************************
** Functions to provide a interface to select results
*****************************************************************************/
...
...
sql/sql_class.h
View file @
5e04e237
...
...
@@ -762,8 +762,15 @@ class Table_ident :public Sql_alloc {
public:
LEX_STRING
db
;
LEX_STRING
table
;
Table_ident
(
LEX_STRING
db_arg
,
LEX_STRING
table_arg
,
bool
force
);
Table_ident
(
LEX_STRING
table_arg
);
inline
Table_ident
(
LEX_STRING
db_arg
,
LEX_STRING
table_arg
,
bool
force
)
:
table
(
table_arg
)
{
if
(
!
force
&&
(
current_thd
->
client_capabilities
&
CLIENT_NO_SCHEMA
))
db
.
str
=
0
;
else
db
=
db_arg
;
}
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 @
5e04e237
...
...
@@ -3396,10 +3396,7 @@ 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
table_case_convert
(
table
->
table
.
str
,
table
->
table
.
length
);
ptr
->
real_name
=
table
->
table
.
str
;
ptr
->
real_name_length
=
table
->
table
.
length
;
ptr
->
lock_type
=
lock_type
;
...
...
sql/sql_table.cc
View file @
5e04e237
...
...
@@ -1463,10 +1463,8 @@ 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 @
5e04e237
...
...
@@ -3221,20 +3221,16 @@ 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