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
96d879cb
Commit
96d879cb
authored
Apr 02, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge pilot.blaudden:/home/msvensson/mysql/mysql-4.1
into pilot.blaudden:/home/msvensson/mysql/mysql-4.1-maint
parents
97c4143e
0bb2f43d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
223 additions
and
50 deletions
+223
-50
client/mysqltest.c
client/mysqltest.c
+1
-6
mysql-test/r/date_formats.result
mysql-test/r/date_formats.result
+18
-39
mysql-test/r/rpl_ignore_table.result
mysql-test/r/rpl_ignore_table.result
+103
-0
mysql-test/t/rpl_ignore_table.test
mysql-test/t/rpl_ignore_table.test
+98
-0
sql-common/my_time.c
sql-common/my_time.c
+1
-4
sql/sql_yacc.yy
sql/sql_yacc.yy
+2
-1
No files found.
client/mysqltest.c
View file @
96d879cb
...
...
@@ -105,7 +105,7 @@ static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0;
static
my_bool
parsing_disabled
=
0
;
static
my_bool
display_result_vertically
=
FALSE
,
display_metadata
=
FALSE
;
static
my_bool
disable_query_log
=
0
,
disable_result_log
=
0
;
static
my_bool
disable_warnings
=
0
,
disable_ps_warnings
=
0
;
static
my_bool
disable_warnings
=
0
;
static
my_bool
disable_info
=
1
;
static
my_bool
abort_on_error
=
1
;
static
my_bool
is_windows
=
0
;
...
...
@@ -264,7 +264,6 @@ enum enum_commands {
Q_ENABLE_RESULT_LOG
,
Q_DISABLE_RESULT_LOG
,
Q_WAIT_FOR_SLAVE_TO_STOP
,
Q_ENABLE_WARNINGS
,
Q_DISABLE_WARNINGS
,
Q_ENABLE_PS_WARNINGS
,
Q_DISABLE_PS_WARNINGS
,
Q_ENABLE_INFO
,
Q_DISABLE_INFO
,
Q_ENABLE_METADATA
,
Q_DISABLE_METADATA
,
Q_EXEC
,
Q_DELIMITER
,
...
...
@@ -328,8 +327,6 @@ const char *command_names[]=
"wait_for_slave_to_stop"
,
"enable_warnings"
,
"disable_warnings"
,
"enable_ps_warnings"
,
"disable_ps_warnings"
,
"enable_info"
,
"disable_info"
,
"enable_metadata"
,
...
...
@@ -6056,8 +6053,6 @@ int main(int argc, char **argv)
case
Q_DISABLE_RESULT_LOG
:
disable_result_log
=
1
;
break
;
case
Q_ENABLE_WARNINGS
:
disable_warnings
=
0
;
break
;
case
Q_DISABLE_WARNINGS
:
disable_warnings
=
1
;
break
;
case
Q_ENABLE_PS_WARNINGS
:
disable_ps_warnings
=
0
;
break
;
case
Q_DISABLE_PS_WARNINGS
:
disable_ps_warnings
=
1
;
break
;
case
Q_ENABLE_INFO
:
disable_info
=
0
;
break
;
case
Q_DISABLE_INFO
:
disable_info
=
1
;
break
;
case
Q_ENABLE_METADATA
:
display_metadata
=
1
;
break
;
...
...
mysql-test/r/date_formats.result
View file @
96d879cb
...
...
@@ -181,12 +181,12 @@ date format datetime
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12
10:20:10 %H:%i:%s 0000-00-00
00:00:0
0
10:20:10 %h:%i:%s.%f 0000-00-00
00:00:0
0
10:20:10 %T 0000-00-00
00:00:0
0
10:20:10AM %h:%i:%s%p 0000-00-00
00:00:0
0
10:20:10AM %r 0000-00-00
00:00:0
0
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00
00:00:
00
10:20:10 %H:%i:%s 0000-00-00
10:20:1
0
10:20:10 %h:%i:%s.%f 0000-00-00
10:20:1
0
10:20:10 %T 0000-00-00
10:20:1
0
10:20:10AM %h:%i:%s%p 0000-00-00
10:20:1
0
10:20:10AM %r 0000-00-00
10:20:1
0
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00
10:20:10.4400
00
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
15 September 2001 %d %M %Y 2001-09-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
...
...
@@ -203,13 +203,6 @@ Tuesday 52 2001 %W %V %X 2002-01-01 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15 00:00:00
15-01-20 %d-%m-%y 2020-01-15 00:00:00
15-2001-1 %d-%Y-%c 2001-01-15 00:00:00
Warnings:
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10.440000'
select date,format,DATE(str_to_date(date, format)) as date2 from t1;
date format date2
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02
...
...
@@ -250,12 +243,12 @@ date format time
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12
10:20:10 %H:%i:%s
NULL
10:20:10 %h:%i:%s.%f
NULL
10:20:10 %T
NULL
10:20:10AM %h:%i:%s%p
NULL
10:20:10AM %r
NULL
10:20:10.44AM %h:%i:%s.%f%p
NULL
10:20:10 %H:%i:%s
10:20:10
10:20:10 %h:%i:%s.%f
10:20:10
10:20:10 %T
10:20:10
10:20:10AM %h:%i:%s%p
10:20:10
10:20:10AM %r
10:20:10
10:20:10.44AM %h:%i:%s.%f%p
10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58
15 September 2001 %d %M %Y 00:00:00
15 SEPTEMB 2001 %d %M %Y 00:00:00
...
...
@@ -272,13 +265,6 @@ Tuesday 52 2001 %W %V %X 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00
15-01-20 %d-%m-%y 00:00:00
15-2001-1 %d-%Y-%c 00:00:00
Warnings:
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10.440000'
select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1;
date format time2
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12
...
...
@@ -288,12 +274,12 @@ date format time2
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12
10:20:10 %H:%i:%s
NULL
10:20:10 %h:%i:%s.%f
NULL
10:20:10 %T
NULL
10:20:10AM %h:%i:%s%p
NULL
10:20:10AM %r
NULL
10:20:10.44AM %h:%i:%s.%f%p
NULL
10:20:10 %H:%i:%s
10:20:10
10:20:10 %h:%i:%s.%f
10:20:10
10:20:10 %T
10:20:10
10:20:10AM %h:%i:%s%p
10:20:10
10:20:10AM %r
10:20:10
10:20:10.44AM %h:%i:%s.%f%p
10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58
15 September 2001 %d %M %Y 00:00:00
15 SEPTEMB 2001 %d %M %Y 00:00:00
...
...
@@ -310,13 +296,6 @@ Tuesday 52 2001 %W %V %X 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00
15-01-20 %d-%m-%y 00:00:00
15-2001-1 %d-%Y-%c 00:00:00
Warnings:
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10.440000'
select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d'));
concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d'))
2003-01-02 08:11:02.123456
...
...
mysql-test/r/rpl_ignore_table.result
View file @
96d879cb
...
...
@@ -14,3 +14,106 @@ SELECT * FROM t4;
a
DROP TABLE t1;
DROP TABLE t4;
**** Test case for BUG#25482 ****
**** Adding GRANTS on master ****
create table test.t1(a int);
create table test.t4(a int);
GRANT SELECT ON test.t1 TO mysqltest1@localhost;
GRANT INSERT ON test.t4 TO mysqltest2@localhost;
GRANT select, update, insert, references on t1
to mysqltest2@localhost;
GRANT SELECT ON test.* TO mysqltest3@localhost;
GRANT INSERT ON test.t4 TO mysqltest3@localhost;
GRANT select(a), update(a), insert(a), references(a) on t4
to mysqltest3@localhost;
create database mysqltest2;
create table mysqltest2.t2 (id int);
GRANT SELECT ON mysqltest2.t2 TO mysqltest4@localhost IDENTIFIED BY 'pass';
insert into mysql.user (user, host) values ("mysqltest5", "somehost");
GRANT SELECT ON *.* TO mysqltest6@localhost;
GRANT INSERT ON *.* TO mysqltest6@localhost;
GRANT INSERT ON test.* TO mysqltest6@localhost;
GRANT INSERT ON test.t1 TO mysqltest6@localhost;
show grants for mysqltest1@localhost;
Grants for mysqltest1@localhost
GRANT USAGE ON *.* TO 'mysqltest1'@'localhost'
GRANT SELECT ON `test`.`t1` TO 'mysqltest1'@'localhost'
show grants for mysqltest2@localhost;
Grants for mysqltest2@localhost
GRANT USAGE ON *.* TO 'mysqltest2'@'localhost'
GRANT SELECT, INSERT, UPDATE, REFERENCES ON `test`.`t1` TO 'mysqltest2'@'localhost'
GRANT INSERT ON `test`.`t4` TO 'mysqltest2'@'localhost'
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
GRANT SELECT ON `mysqltest2`.`t2` TO 'mysqltest4'@'localhost'
show grants for mysqltest6@localhost;
Grants for mysqltest6@localhost
GRANT SELECT, INSERT ON *.* TO 'mysqltest6'@'localhost'
GRANT INSERT ON `test`.* TO 'mysqltest6'@'localhost'
GRANT INSERT ON `test`.`t1` TO 'mysqltest6'@'localhost'
flush privileges;
show grants for mysqltest5@somehost;
Grants for mysqltest5@somehost
GRANT USAGE ON *.* TO 'mysqltest5'@'somehost'
**** Checking grants on slave ****
show grants for mysqltest2@localhost;
Grants for mysqltest2@localhost
GRANT USAGE ON *.* TO 'mysqltest2'@'localhost'
GRANT INSERT ON `test`.`t4` TO 'mysqltest2'@'localhost'
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
GRANT SELECT ON `mysqltest2`.`t2` TO 'mysqltest4'@'localhost'
show grants for mysqltest5@somehost;
Grants for mysqltest5@somehost
GRANT USAGE ON *.* TO 'mysqltest5'@'somehost'
show grants for mysqltest6@localhost;
Grants for mysqltest6@localhost
GRANT SELECT, INSERT ON *.* TO 'mysqltest6'@'localhost'
GRANT INSERT ON `test`.* TO 'mysqltest6'@'localhost'
show grants for mysqltest1@localhost;
ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost'
**** Revoking grants on master ****
REVOKE SELECT ON test.t1 FROM mysqltest1@localhost;
REVOKE SELECT ON mysqltest2.t2 FROM mysqltest4@localhost;
REVOKE select(a) on t4
from mysqltest3@localhost;
show grants for mysqltest1@localhost;
Grants for mysqltest1@localhost
GRANT USAGE ON *.* TO 'mysqltest1'@'localhost'
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
**** Checking grants on slave ****
show grants for mysqltest1@localhost;
ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost'
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
drop table t1, t4, mysqltest2.t2;
drop database mysqltest2;
delete from mysql.user where user like "mysqltest%";
delete from mysql.db where user like "mysqltest%";
delete from mysql.tables_priv where user like "mysqltest%";
delete from mysql.columns_priv where user like "mysqltest%";
mysql-test/t/rpl_ignore_table.test
View file @
96d879cb
...
...
@@ -26,3 +26,101 @@ SELECT * FROM t4;
connection
master
;
DROP
TABLE
t1
;
DROP
TABLE
t4
;
#
# Bug#25482 GRANT statements are not replicated if
# you use "replicate-ignore-table"
#
--
echo
****
Test
case
for
BUG
#25482 ****
--
echo
****
Adding
GRANTS
on
master
****
connection
master
;
create
table
test
.
t1
(
a
int
);
create
table
test
.
t4
(
a
int
);
# Simple user that should not replicate
GRANT
SELECT
ON
test
.
t1
TO
mysqltest1
@
localhost
;
# Partial replicate
GRANT
INSERT
ON
test
.
t4
TO
mysqltest2
@
localhost
;
GRANT
select
,
update
,
insert
,
references
on
t1
to
mysqltest2
@
localhost
;
# Partial replicate 2
GRANT
SELECT
ON
test
.*
TO
mysqltest3
@
localhost
;
GRANT
INSERT
ON
test
.
t4
TO
mysqltest3
@
localhost
;
GRANT
select
(
a
),
update
(
a
),
insert
(
a
),
references
(
a
)
on
t4
to
mysqltest3
@
localhost
;
# Create another database and table
create
database
mysqltest2
;
create
table
mysqltest2
.
t2
(
id
int
);
# Create a grant that should replicate
GRANT
SELECT
ON
mysqltest2
.
t2
TO
mysqltest4
@
localhost
IDENTIFIED
BY
'pass'
;
# Create a grant manually
insert
into
mysql
.
user
(
user
,
host
)
values
(
"mysqltest5"
,
"somehost"
);
# Partial replicate 3 with *.*
GRANT
SELECT
ON
*.*
TO
mysqltest6
@
localhost
;
GRANT
INSERT
ON
*.*
TO
mysqltest6
@
localhost
;
GRANT
INSERT
ON
test
.*
TO
mysqltest6
@
localhost
;
GRANT
INSERT
ON
test
.
t1
TO
mysqltest6
@
localhost
;
show
grants
for
mysqltest1
@
localhost
;
show
grants
for
mysqltest2
@
localhost
;
show
grants
for
mysqltest3
@
localhost
;
show
grants
for
mysqltest4
@
localhost
;
show
grants
for
mysqltest6
@
localhost
;
flush
privileges
;
show
grants
for
mysqltest5
@
somehost
;
sync_slave_with_master
;
--
echo
****
Checking
grants
on
slave
****
# Check that grants are replicated to slave
show
grants
for
mysqltest2
@
localhost
;
show
grants
for
mysqltest3
@
localhost
;
show
grants
for
mysqltest4
@
localhost
;
show
grants
for
mysqltest5
@
somehost
;
show
grants
for
mysqltest6
@
localhost
;
# mysqltest1 should not be on slave
--
error
1141
show
grants
for
mysqltest1
@
localhost
;
--
echo
****
Revoking
grants
on
master
****
connection
master
;
REVOKE
SELECT
ON
test
.
t1
FROM
mysqltest1
@
localhost
;
REVOKE
SELECT
ON
mysqltest2
.
t2
FROM
mysqltest4
@
localhost
;
REVOKE
select
(
a
)
on
t4
from
mysqltest3
@
localhost
;
show
grants
for
mysqltest1
@
localhost
;
show
grants
for
mysqltest3
@
localhost
;
show
grants
for
mysqltest4
@
localhost
;
sync_slave_with_master
;
--
echo
****
Checking
grants
on
slave
****
# mysqltest1 should not be on slave
--
error
1141
show
grants
for
mysqltest1
@
localhost
;
show
grants
for
mysqltest3
@
localhost
;
show
grants
for
mysqltest4
@
localhost
;
# Cleanup
connection
master
;
drop
table
t1
,
t4
,
mysqltest2
.
t2
;
drop
database
mysqltest2
;
delete
from
mysql
.
user
where
user
like
"mysqltest%"
;
delete
from
mysql
.
db
where
user
like
"mysqltest%"
;
delete
from
mysql
.
tables_priv
where
user
like
"mysqltest%"
;
delete
from
mysql
.
columns_priv
where
user
like
"mysqltest%"
;
sync_slave_with_master
;
sql-common/my_time.c
View file @
96d879cb
...
...
@@ -350,10 +350,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
l_time
->
year
>
9999
||
l_time
->
month
>
12
||
l_time
->
day
>
31
||
l_time
->
hour
>
23
||
l_time
->
minute
>
59
||
l_time
->
second
>
59
||
(
!
(
flags
&
TIME_FUZZY_DATE
)
&&
(
l_time
->
month
==
0
||
l_time
->
day
==
0
))
||
(
l_time
->
year
==
0
&&
l_time
->
month
==
0
&&
l_time
->
day
==
0
&&
(
l_time
->
hour
!=
0
||
l_time
->
minute
!=
0
||
l_time
->
second
!=
0
)))
(
!
(
flags
&
TIME_FUZZY_DATE
)
&&
(
l_time
->
month
==
0
||
l_time
->
day
==
0
)))
{
/* Only give warning for a zero date if there is some garbage after */
if
(
!
not_zero_date
)
/* If zero date */
...
...
sql/sql_yacc.yy
View file @
96d879cb
...
...
@@ -5926,7 +5926,8 @@ opt_table:
| table_ident
{
LEX *lex=Lex;
if (!lex->current_select->add_table_to_list(lex->thd, $1,NULL,0))
if (!lex->current_select->add_table_to_list(lex->thd, $1,NULL,
TL_OPTION_UPDATING))
YYABORT;
if (lex->grant == GLOBAL_ACLS)
lex->grant = TABLE_ACLS & ~GRANT_ACL;
...
...
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