Replication Bug with underscore

Replication Bug with underscore

am 26.11.2003 11:15:13 von Brian Piere

When I run SHOW SLAVE STATUS I get the following error....

-----------------
n.005 | 35671 | plain-relay-bin.003 | 12158086 |
server-bin.
003 | Yes | No | |
| 1133 | Error 'Can't find any matching row in the user
table' o
n query 'GRANT ALL ON `printsma\_prints`.* TO 'printsma_brian'@'localhost''.
Def
ault database: 'mysql' | 0 | 14366122 | 540788708
-------------------

The reason the query is failing is because my user name has an underscore in
it. The following query works...
GRANT ALL ON `printsma\_prints`.* TO 'printsma\_brian'@'localhost'

It looks like you are escaping the underscore within the database name but
not within the user name.

Thanks for looking into it
~Brian


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: Replication Bug with underscore

am 26.11.2003 15:01:34 von Sinisa Milivojevic

Brian Piere writes:
> When I run SHOW SLAVE STATUS I get the following error....
>
> -----------------
> n.005 | 35671 | plain-relay-bin.003 | 12158086 |
> server-bin.
> 003 | Yes | No | |
> | 1133 | Error 'Can't find any matching row in the user
> table' o
> n query 'GRANT ALL ON `printsma\_prints`.* TO 'printsma_brian'@'localhost''.
> Def
> ault database: 'mysql' | 0 | 14366122 | 540788708
> -------------------
>
> The reason the query is failing is because my user name has an underscore in
> it. The following query works...
> GRANT ALL ON `printsma\_prints`.* TO 'printsma\_brian'@'localhost'
>
> It looks like you are escaping the underscore within the database name but
> not within the user name.
>
> Thanks for looking into it
> ~Brian

Hi!

What is the MySQL version you are using and are your master and slave
running the same version of MySQL ???

The aboe command worked fine as is:


[/mnt/work/mysql-4.0]$ ./client/mysql -e "grant all on rintsma_prints.* to 'printsma_brian'@localhost"
[/mnt/work/mysql-4.0]$ ./client/mysql -e "show grants for 'printsma_brian'@localhost"
+----------------------------------------------------------- ------------------------------------------------------------ -------------+
| Grants for printsma_brian@localhost |
+----------------------------------------------------------- ------------------------------------------------------------ -------------+
| GRANT USAGE ON *.* TO 'printsma_brian'@'localhost' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER ON `rintsma_prints`.* TO 'printsma_brian'@'localhost' |
+----------------------------------------------------------- ------------------------------------------------------------ -------------+


--

Sincerely,

--
For technical support contracts, go to https://order.mysql.com/?ref=msmi
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB
/_/ /_/\_, /___/\___\_\___/ Fulltime Developer and Support Coordinator
<___/ www.mysql.com Larnaca, Cyprus


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: Replication Bug with underscore

am 26.11.2003 18:11:16 von Paul DuBois

At 2:15 -0800 11/26/03, Brian Piere wrote:
>When I run SHOW SLAVE STATUS I get the following error....
>
>-----------------
>n.005 | 35671 | plain-relay-bin.003 | 12158086 |
>server-bin.
>003 | Yes | No | |
> | 1133 | Error 'Can't find any matching row in the user
>table' o
>n query 'GRANT ALL ON `printsma\_prints`.* TO 'printsma_brian'@'localhost''.
>Def
>ault database: 'mysql' | 0 | 14366122 | 540788708
>-------------------
>
>The reason the query is failing is because my user name has an underscore in
>it. The following query works...
>GRANT ALL ON `printsma\_prints`.* TO 'printsma\_brian'@'localhost'
>
>It looks like you are escaping the underscore within the database name but
>not within the user name.

I suspect that is not the problem.

Wildcard characters are special in host and database names, but not in
usernames. '_' doesn't need to be escaped in a username.

Granting privileges to a username of 'printsma_brian' is different than
granting privileges to a username of 'printsma\_brian'. At least, I just
tried this both ways on 4.0.14, and I end up with separate lines in the
grant tables. I also end up with distinct output for both names when I
use SHOW GRANTS.

Do you have a case where you specify \_ in the GRANT but don't get it
in the output of SHOW GRANTS, or where you specify _ in the grant but
don't get it in the output of SHOW GRANTS?

>
>Thanks for looking into it
>~Brian
>
>
>--
>MySQL Bugs Mailing List
>For list archives: http://lists.mysql.com/bugs
>To unsubscribe: http://lists.mysql.com/bugs?unsub=paul@mysql.com


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification/


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

RE: Replication Bug with underscore

am 27.11.2003 04:38:38 von Brian Piere

I am using...
Ver 4.0.15-standard for pc-linux on i686
The same version is running on both the master and the slave.


This statment gives an errror
GRANT ALL ON `printsma\_prints`.* TO 'printsma_brian'@'localhost';
ERROR 1133: Can't find any matching row in the user table

This one works
GRANT ALL ON `printsma\_prints`.* TO 'printsma\_brian'@'localhost'


This is part of the "user" and "host" list within the "mysql" DB


| printsma | localhost |
| printsma\_brian | localhost |
| printsma_brian | localhost |
| printsma_worldsh | localhost |
| riadmin | localhost |


So something funny with the backslash happened there, ... I did not put it
there, the replication software did.

Just to give you a brief background... I have 2 dedicated servers setup and
this server has my slave running on it. I made a mistake setting up the
binary log on the master. I forgot to use the switch "binlog-do-db=" ...
So the binary log was recording everything. Those grant statements should
never have been run on the slave. The problem is fixed now, but I just
wanted to let you guys know because something seems fishy with it.

Thanks for your quick reply. I am grateful to use MySQL!

~Brian



-----Original Message-----
From: Paul DuBois [mailto:paul@mysql.com]
Sent: Wednesday, November 26, 2003 9:11 AM
To: Brian Piere; bugs@lists.mysql.com
Subject: Re: Replication Bug with underscore


At 2:15 -0800 11/26/03, Brian Piere wrote:
>When I run SHOW SLAVE STATUS I get the following error....
>
>-----------------
>n.005 | 35671 | plain-relay-bin.003 | 12158086 |
>server-bin.
>003 | Yes | No | |
> | 1133 | Error 'Can't find any matching row in the user
>table' o
>n query 'GRANT ALL ON `printsma\_prints`.* TO
'printsma_brian'@'localhost''.
>Def
>ault database: 'mysql' | 0 | 14366122 | 540788708
>-------------------
>
>The reason the query is failing is because my user name has an underscore
in
>it. The following query works...
>GRANT ALL ON `printsma\_prints`.* TO 'printsma\_brian'@'localhost'
>
>It looks like you are escaping the underscore within the database name but
>not within the user name.

I suspect that is not the problem.

Wildcard characters are special in host and database names, but not in
usernames. '_' doesn't need to be escaped in a username.

Granting privileges to a username of 'printsma_brian' is different than
granting privileges to a username of 'printsma\_brian'. At least, I just
tried this both ways on 4.0.14, and I end up with separate lines in the
grant tables. I also end up with distinct output for both names when I
use SHOW GRANTS.

Do you have a case where you specify \_ in the GRANT but don't get it
in the output of SHOW GRANTS, or where you specify _ in the grant but
don't get it in the output of SHOW GRANTS?

>
>Thanks for looking into it
>~Brian
>
>
>--
>MySQL Bugs Mailing List
>For list archives: http://lists.mysql.com/bugs
>To unsubscribe: http://lists.mysql.com/bugs?unsub=paul@mysql.com


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification/




--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org