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
abb75129
Commit
abb75129
authored
Jul 13, 2006
by
igreenhoe/greenman@anubis.greendragongames.com
Browse files
Options
Browse Files
Download
Plain Diff
4.1 -> 5.0 merge
parents
878107eb
b4c8f536
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
245 additions
and
124 deletions
+245
-124
client/mysql.cc
client/mysql.cc
+1
-1
client/mysqldump.c
client/mysqldump.c
+13
-10
mysql-test/include/have_case_sensitive_file_system.inc
mysql-test/include/have_case_sensitive_file_system.inc
+4
-0
mysql-test/r/case_sensitive_file_system.require
mysql-test/r/case_sensitive_file_system.require
+2
-0
mysql-test/r/date_formats.result
mysql-test/r/date_formats.result
+6
-0
mysql-test/r/lowercase_fs_off.result
mysql-test/r/lowercase_fs_off.result
+11
-0
mysql-test/r/mysql_client.result
mysql-test/r/mysql_client.result
+4
-0
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+72
-108
mysql-test/r/ps.result
mysql-test/r/ps.result
+14
-0
mysql-test/t/date_formats.test
mysql-test/t/date_formats.test
+7
-1
mysql-test/t/lowercase_fs_off.test
mysql-test/t/lowercase_fs_off.test
+27
-0
mysql-test/t/mysql_client.test
mysql-test/t/mysql_client.test
+29
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+24
-0
sql/item_func.h
sql/item_func.h
+4
-1
sql/sql_acl.cc
sql/sql_acl.cc
+2
-2
sql/sql_lex.cc
sql/sql_lex.cc
+1
-0
sql/sql_prepare.cc
sql/sql_prepare.cc
+2
-1
sql/table.cc
sql/table.cc
+17
-0
sql/table.h
sql/table.h
+5
-0
No files found.
client/mysql.cc
View file @
abb75129
...
...
@@ -1084,7 +1084,7 @@ static int read_and_execute(bool interactive)
(We want to allow help, print and clear anywhere at line start
*/
if
((
named_cmds
||
glob_buffer
.
is_empty
())
&&
!
in_string
&&
(
com
=
find_command
(
line
,
0
)))
&&
!
ml_comment
&&
!
in_string
&&
(
com
=
find_command
(
line
,
0
)))
{
if
((
*
com
->
func
)(
&
glob_buffer
,
line
)
>
0
)
break
;
...
...
client/mysqldump.c
View file @
abb75129
...
...
@@ -2239,15 +2239,16 @@ static void dump_table(char *table, char *db)
goto
err
;
}
if
(
opt_
disable_keys
)
if
(
opt_
lock
)
{
fprintf
(
md_result_file
,
"
\n
/*!40000 ALTER TABLE %s DISABLE KEYS */;
\n
"
,
opt_quoted_table
);
fprintf
(
md_result_file
,
"LOCK TABLES %s WRITE;
\n
"
,
opt_quoted_table
);
check_io
(
md_result_file
);
}
if
(
opt_lock
)
/* Moved disable keys to after lock per bug 15977 */
if
(
opt_disable_keys
)
{
fprintf
(
md_result_file
,
"LOCK TABLES %s WRITE;
\n
"
,
opt_quoted_table
);
fprintf
(
md_result_file
,
"/*!40000 ALTER TABLE %s DISABLE KEYS */;
\n
"
,
opt_quoted_table
);
check_io
(
md_result_file
);
}
...
...
@@ -2511,17 +2512,19 @@ static void dump_table(char *table, char *db)
error
=
EX_CONSCHECK
;
goto
err
;
}
if
(
opt_lock
)
{
fputs
(
"UNLOCK TABLES;
\n
"
,
md_result_file
);
check_io
(
md_result_file
);
}
/* Moved enable keys to before unlock per bug 15977 */
if
(
opt_disable_keys
)
{
fprintf
(
md_result_file
,
"/*!40000 ALTER TABLE %s ENABLE KEYS */;
\n
"
,
opt_quoted_table
);
check_io
(
md_result_file
);
}
if
(
opt_lock
)
{
fputs
(
"UNLOCK TABLES;
\n
"
,
md_result_file
);
check_io
(
md_result_file
);
}
if
(
opt_autocommit
)
{
fprintf
(
md_result_file
,
"commit;
\n
"
);
...
...
mysql-test/include/have_case_sensitive_file_system.inc
0 → 100644
View file @
abb75129
--
require
r
/
case_sensitive_file_system
.
require
--
disable_query_log
show
variables
like
"lower_case_file_system"
;
--
enable_query_log
mysql-test/r/case_sensitive_file_system.require
0 → 100644
View file @
abb75129
Variable_name Value
lower_case_file_system OFF
mysql-test/r/date_formats.result
View file @
abb75129
...
...
@@ -564,3 +564,9 @@ TIME_FORMAT("24:00:00", '%l %p')
SELECT TIME_FORMAT("25:00:00", '%l %p');
TIME_FORMAT("25:00:00", '%l %p')
1 AM
SELECT DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896);
DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896)
NULL
Warnings:
Warning 1292 Truncated incorrect datetime value: '%Y-%m-%d %H:%i:%s'
"End of 4.1 tests"
mysql-test/r/lowercase_fs_off.result
0 → 100644
View file @
abb75129
create database d1;
grant all on d1.* to 'sample'@'localhost' identified by 'password';
flush privileges;
select database();
database()
d1
create database d2;
ERROR 42000: Access denied for user 'sample'@'localhost' to database 'd2'
create database D1;
ERROR 42000: Access denied for user 'sample'@'localhost' to database 'D1'
drop database if exists d1;
mysql-test/r/mysql_client.result
0 → 100644
View file @
abb75129
1
1
ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
ERROR at line 1: USE must be followed by a database name
mysql-test/r/mysqldump.result
View file @
abb75129
This diff is collapsed.
Click to expand it.
mysql-test/r/ps.result
View file @
abb75129
...
...
@@ -502,6 +502,20 @@ SELECT FOUND_ROWS();
FOUND_ROWS()
2
deallocate prepare stmt;
drop table if exists t1;
create temporary table if not exists t1 (a1 int);
prepare stmt from "delete t1 from t1 where (cast(a1/3 as unsigned) * 3) = a1";
drop temporary table t1;
create temporary table if not exists t1 (a1 int);
execute stmt;
drop temporary table t1;
create temporary table if not exists t1 (a1 int);
execute stmt;
drop temporary table t1;
create temporary table if not exists t1 (a1 int);
execute stmt;
drop temporary table t1;
deallocate prepare stmt;
create table t1 (a char(3) not null, b char(3) not null,
c char(3) not null, primary key (a, b, c));
create table t2 like t1;
...
...
mysql-test/t/date_formats.test
View file @
abb75129
...
...
@@ -290,7 +290,6 @@ drop table t1;
select
str_to_date
(
1
,
NULL
);
select
str_to_date
(
NULL
,
1
);
select
str_to_date
(
1
,
IF
(
1
=
1
,
NULL
,
NULL
)
);
# End of 4.1 tests
#
# Bug#11326
...
...
@@ -321,3 +320,10 @@ SELECT TIME_FORMAT("12:00:00", '%l %p');
SELECT
TIME_FORMAT
(
"23:00:00"
,
'%l %p'
);
SELECT
TIME_FORMAT
(
"24:00:00"
,
'%l %p'
);
SELECT
TIME_FORMAT
(
"25:00:00"
,
'%l %p'
);
#
# Bug#20729: Bad date_format() call makes mysql server crash
#
SELECT
DATE_FORMAT
(
'%Y-%m-%d %H:%i:%s'
,
1151414896
);
--
echo
"End of 4.1 tests"
mysql-test/t/lowercase_fs_off.test
0 → 100644
View file @
abb75129
#
# Specific tests for case sensitive file systems
# i.e. lower_case_filesystem=OFF
#
--
source
include
/
have_case_sensitive_file_system
.
inc
connect
(
master
,
localhost
,
root
,,);
connection
master
;
create
database
d1
;
grant
all
on
d1
.*
to
'sample'
@
'localhost'
identified
by
'password'
;
flush
privileges
;
connect
(
sample
,
localhost
,
sample
,
password
,
d1
);
connection
sample
;
select
database
();
--
error
1044
create
database
d2
;
--
error
1044
create
database
D1
;
disconnect
sample
;
connection
master
;
drop
database
if
exists
d1
;
disconnect
master
;
connection
default
;
# End of 4.1 tests
mysql-test/t/mysql_client.test
0 → 100644
View file @
abb75129
# This test should work in embedded server after we fix mysqltest
--
source
include
/
not_embedded
.
inc
#
# Bug #20432: mysql client interprets commands in comments
#
# if the client sees the 'use' within the comment, we haven't fixed
--
exec
echo
"/*"
>
$MYSQLTEST_VARDIR
/
tmp
/
bug20432
.
sql
--
exec
echo
"use"
>>
$MYSQLTEST_VARDIR
/
tmp
/
bug20432
.
sql
--
exec
echo
"*/"
>>
$MYSQLTEST_VARDIR
/
tmp
/
bug20432
.
sql
--
exec
$MYSQL
<
$MYSQLTEST_VARDIR
/
tmp
/
bug20432
.
sql
2
>&
1
# SQL can have embedded comments => workie
--
exec
echo
"select /*"
>
$MYSQLTEST_VARDIR
/
tmp
/
bug20432
.
sql
--
exec
echo
"use"
>>
$MYSQLTEST_VARDIR
/
tmp
/
bug20432
.
sql
--
exec
echo
"*/ 1"
>>
$MYSQLTEST_VARDIR
/
tmp
/
bug20432
.
sql
--
exec
$MYSQL
<
$MYSQLTEST_VARDIR
/
tmp
/
bug20432
.
sql
2
>&
1
# client commands on the other hand must be at BOL => error
--
exec
echo
"/*"
>
$MYSQLTEST_VARDIR
/
tmp
/
bug20432
.
sql
--
exec
echo
"xxx"
>>
$MYSQLTEST_VARDIR
/
tmp
/
bug20432
.
sql
--
exec
echo
"*/ use"
>>
$MYSQLTEST_VARDIR
/
tmp
/
bug20432
.
sql
--
error
1
--
exec
$MYSQL
<
$MYSQLTEST_VARDIR
/
tmp
/
bug20432
.
sql
2
>&
1
# client comment recognized, but parameter missing => error
--
exec
echo
"use"
>
$MYSQLTEST_VARDIR
/
tmp
/
bug20432
.
sql
--
exec
$MYSQL
<
$MYSQLTEST_VARDIR
/
tmp
/
bug20432
.
sql
2
>&
1
mysql-test/t/ps.test
View file @
abb75129
...
...
@@ -491,6 +491,30 @@ deallocate prepare stmt;
drop
table
t1
,
t2
;
#
# Bug#19399 "Stored Procedures 'Lost Connection' when dropping/creating
# tables"
# Check that multi-delete tables are also cleaned up before re-execution.
#
--
disable_warnings
drop
table
if
exists
t1
;
create
temporary
table
if
not
exists
t1
(
a1
int
);
--
enable_warnings
# exact delete syntax is essential
prepare
stmt
from
"delete t1 from t1 where (cast(a1/3 as unsigned) * 3) = a1"
;
drop
temporary
table
t1
;
create
temporary
table
if
not
exists
t1
(
a1
int
);
# the server crashed on the next statement without the fix
execute
stmt
;
drop
temporary
table
t1
;
create
temporary
table
if
not
exists
t1
(
a1
int
);
# the problem was in memory corruption: repeat the test just in case
execute
stmt
;
drop
temporary
table
t1
;
create
temporary
table
if
not
exists
t1
(
a1
int
);
execute
stmt
;
drop
temporary
table
t1
;
deallocate
prepare
stmt
;
# Bug#6102 "Server crash with prepared statement and blank after
# function name"
# ensure that stored functions are cached when preparing a statement
...
...
sql/item_func.h
View file @
abb75129
...
...
@@ -156,7 +156,10 @@ class Item_func :public Item_result_field
{
return
(
null_value
=
args
[
0
]
->
get_time
(
ltime
));
}
bool
is_null
()
{
(
void
)
val_int
();
return
null_value
;
}
bool
is_null
()
{
(
void
)
val_int
();
/* Discard result. It sets null_value as side-effect. */
return
null_value
;
}
void
signal_divide_by_null
();
friend
class
udf_handler
;
Field
*
tmp_table_field
()
{
return
result_field
;
}
...
...
sql/sql_acl.cc
View file @
abb75129
...
...
@@ -149,8 +149,8 @@ my_bool acl_init(bool dont_read_acl_tables)
acl_cache
=
new
hash_filo
(
ACL_CACHE_SIZE
,
0
,
0
,
(
hash_get_key
)
acl_entry_get_key
,
(
hash_free_key
)
free
,
/* Use the case sensitive "binary" charset */
&
my_charset_bin
);
lower_case_file_system
?
system_charset_info
:
&
my_charset_bin
);
if
(
dont_read_acl_tables
)
{
DBUG_RETURN
(
0
);
/* purecov: tested */
...
...
sql/sql_lex.cc
View file @
abb75129
...
...
@@ -124,6 +124,7 @@ void lex_start(THD *thd, uchar *buf,uint length)
lex
->
value_list
.
empty
();
lex
->
update_list
.
empty
();
lex
->
param_list
.
empty
();
lex
->
auxilliary_table_list
.
empty
();
lex
->
view_list
.
empty
();
lex
->
prepared_stmt_params
.
empty
();
lex
->
unit
.
next
=
lex
->
unit
.
master
=
...
...
sql/sql_prepare.cc
View file @
abb75129
...
...
@@ -2135,7 +2135,8 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
Reset old pointers to TABLEs: they are not valid since the tables
were closed in the end of previous prepare or execute call.
*/
tables
->
table
=
0
;
tables
->
reinit_before_use
(
thd
);
/* Reset is_schema_table_processed value(needed for I_S tables */
tables
->
is_schema_table_processed
=
FALSE
;
...
...
sql/table.cc
View file @
abb75129
...
...
@@ -2985,6 +2985,23 @@ Field_iterator_table_ref::get_natural_column_ref()
return
nj_col
;
}
/*
Cleanup this table for re-execution.
SYNOPSIS
st_table_list::reinit_before_use()
*/
void
st_table_list
::
reinit_before_use
(
THD
*
/* thd */
)
{
/*
Reset old pointers to TABLEs: they are not valid since the tables
were closed in the end of previous prepare or execute call.
*/
table
=
0
;
table_list
=
0
;
}
/*****************************************************************************
** Instansiate templates
...
...
sql/table.h
View file @
abb75129
...
...
@@ -668,6 +668,11 @@ typedef struct st_table_list
Security_context
*
find_view_security_context
(
THD
*
thd
);
bool
prepare_view_securety_context
(
THD
*
thd
);
#endif
/*
Cleanup for re-execution in a prepared statement or a stored
procedure.
*/
void
reinit_before_use
(
THD
*
thd
);
private:
bool
prep_check_option
(
THD
*
thd
,
uint8
check_opt_type
);
...
...
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