Doing select @a does not work in replication.

Doing select @a does not work in replication.

am 02.04.2003 17:53:39 von Scott Wong

I'm not sure if this is a feature or not so i'll just report it as a =
possible bug.
I couldnt find anything in the documentation. =20


How to repeat:

create table t1(id int);
insert into t1 set id=3D0;
select @a:max(id)+1 from t1;
insert into t1 id=3D@a;


Result on master:=20

mysql> select * from t1;
+------+
| id |
+------+
| 0 |
| 1 |
+------+
2 rows in set (0.00 sec)


result on slave:

mysql> select * from t1;
+------+
| id |
+------+
| 0 |
| NULL |
+------+

Binlog shows
insert into t1 set id=3D@a;=20
on both master and slave.


Fix:?

Thank you for your time,
Scott Wong
Meiko America, INC


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql@m.gmane.org

Re: Doing select @a does not work in replication.

am 02.04.2003 19:18:18 von Gelu Gogancea

Hi,
....the sysntax it's not quite normal.You should try :
select @a:=max(id)+1 from t1;
To test if the variable @a is "loaded" with what you expect, you can do:
select @a;
....if the result is NULL something is working wrong.

Anyhow, i wonder how it works on the master ?

Regards,

Gelu
_____________________________________________________
G.NET SOFTWARE COMPANY

Permanent e-mail address : gg@gonetsoftware.com
gelugogancea@yahoo.com
----- Original Message -----
From: "Scott Wong"
To:
Cc:
Sent: Wednesday, April 02, 2003 6:53 PM
Subject: Doing select @a does not work in replication.


I'm not sure if this is a feature or not so i'll just report it as a
possible bug.
I couldnt find anything in the documentation.


How to repeat:

create table t1(id int);
insert into t1 set id=0;
select @a:max(id)+1 from t1;

insert into t1 id=@a;


Result on master:

mysql> select * from t1;
+------+
| id |
+------+
| 0 |
| 1 |
+------+
2 rows in set (0.00 sec)


result on slave:

mysql> select * from t1;
+------+
| id |
+------+
| 0 |
| NULL |
+------+

Binlog shows
insert into t1 set id=@a;
on both master and slave.


Fix:?

Thank you for your time,
Scott Wong
Meiko America, INC


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=ggelu@arctic.ro



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

Re: Doing select @a does not work in replication.

am 02.04.2003 19:18:18 von Gelu Gogancea

Hi,
....the sysntax it's not quite normal.You should try :
select @a:=max(id)+1 from t1;
To test if the variable @a is "loaded" with what you expect, you can do:
select @a;
....if the result is NULL something is working wrong.

Anyhow, i wonder how it works on the master ?

Regards,

Gelu
_____________________________________________________
G.NET SOFTWARE COMPANY

Permanent e-mail address : gg@gonetsoftware.com
gelugogancea@yahoo.com
----- Original Message -----
From: "Scott Wong"
To:
Cc:
Sent: Wednesday, April 02, 2003 6:53 PM
Subject: Doing select @a does not work in replication.


I'm not sure if this is a feature or not so i'll just report it as a
possible bug.
I couldnt find anything in the documentation.


How to repeat:

create table t1(id int);
insert into t1 set id=0;
select @a:max(id)+1 from t1;

insert into t1 id=@a;


Result on master:

mysql> select * from t1;
+------+
| id |
+------+
| 0 |
| 1 |
+------+
2 rows in set (0.00 sec)


result on slave:

mysql> select * from t1;
+------+
| id |
+------+
| 0 |
| NULL |
+------+

Binlog shows
insert into t1 set id=@a;
on both master and slave.


Fix:?

Thank you for your time,
Scott Wong
Meiko America, INC


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=ggelu@arctic.ro



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

Re: Doing select @a does not work in replication.

am 02.04.2003 19:21:47 von Sinisa Milivojevic

Scott Wong writes:
> I'm not sure if this is a feature or not so i'll just report it as a possible bug.
> I couldnt find anything in the documentation.
>
>
> How to repeat:
>
> create table t1(id int);
> insert into t1 set id=0;
> select @a:max(id)+1 from t1;
> insert into t1 id=@a;
>
>
> Result on master:
>
> mysql> select * from t1;
> +------+
> | id |
> +------+
> | 0 |
> | 1 |
> +------+
> 2 rows in set (0.00 sec)
>
>
> result on slave:
>
> mysql> select * from t1;
> +------+
> | id |
> +------+
> | 0 |
> | NULL |
> +------+
>
> Binlog shows
> insert into t1 set id=@a;
> on both master and slave.
>
>
> Fix:?
>
> Thank you for your time,
> Scott Wong
> Meiko America, INC
>

Hi!

It is actually neither.

Replication with user variables is working only in version 4.1.

--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com



--
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: Doing select @a does not work in replication.

am 02.04.2003 19:21:47 von Sinisa Milivojevic

Scott Wong writes:
> I'm not sure if this is a feature or not so i'll just report it as a possible bug.
> I couldnt find anything in the documentation.
>
>
> How to repeat:
>
> create table t1(id int);
> insert into t1 set id=0;
> select @a:max(id)+1 from t1;
> insert into t1 id=@a;
>
>
> Result on master:
>
> mysql> select * from t1;
> +------+
> | id |
> +------+
> | 0 |
> | 1 |
> +------+
> 2 rows in set (0.00 sec)
>
>
> result on slave:
>
> mysql> select * from t1;
> +------+
> | id |
> +------+
> | 0 |
> | NULL |
> +------+
>
> Binlog shows
> insert into t1 set id=@a;
> on both master and slave.
>
>
> Fix:?
>
> Thank you for your time,
> Scott Wong
> Meiko America, INC
>

Hi!

It is actually neither.

Replication with user variables is working only in version 4.1.

--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com



--
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