Unix Technical Forum

Rows being matched during SELECT but not UPDATE

This is a discussion on Rows being matched during SELECT but not UPDATE within the MySQL forums, part of the Database Server Software category; --> How's this for an anomaly ... mysql> SELECT * FROM clients WHERE username = 'aaa' AND pwd = 'bbb' ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 10:11 AM
nobrow@gmail.com
 
Posts: n/a
Default Rows being matched during SELECT but not UPDATE

How's this for an anomaly ...

mysql> SELECT * FROM clients WHERE username = 'aaa' AND pwd = 'bbb'
LIMIT 1;
<snip>
1 row in set (0.00 sec)

mysql> UPDATE clients SET last_login = NOW() WHERE username = 'aaa'
AND pwd = 'bbb' LIMIT 1;
Query OK, 0 rows affected (0.01 sec)
Rows matched: 0 Changed: 0 Warnings: 0

The update no longer appears to find any matching rows. This has
worked perfectly for weeks. No changes were made to my code, but it
suddenly stopped working.

The only thing I can think of is that I upgraded a number of packages
on my system (Gentoo) over the last few days. Perhaps MySQL depends on
one of these packages for updates, but the above still looks pretty
implausible to me.

I'll rebuild MySQL (for want of any better ideas) and see what
happens. In the meantime I just thought I'd share this one with yis.
Any comments/suggestions appreciated.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 10:11 AM
nobrow@gmail.com
 
Posts: n/a
Default Re: Rows being matched during SELECT but not UPDATE

On Jul 8, 12:12 pm, nob...@gmail.com wrote:
> How's this for an anomaly ...
>
> mysql> SELECT * FROM clients WHERE username = 'aaa' AND pwd = 'bbb'
> LIMIT 1;
> <snip>
> 1 row in set (0.00 sec)
>
> mysql> UPDATE clients SET last_login = NOW() WHERE username = 'aaa'
> AND pwd = 'bbb' LIMIT 1;
> Query OK, 0 rows affected (0.01 sec)
> Rows matched: 0 Changed: 0 Warnings: 0
>
> The update no longer appears to find any matching rows. This has
> worked perfectly for weeks. No changes were made to my code, but it
> suddenly stopped working.
>
> The only thing I can think of is that I upgraded a number of packages
> on my system (Gentoo) over the last few days. Perhaps MySQL depends on
> one of these packages for updates, but the above still looks pretty
> implausible to me.
>
> I'll rebuild MySQL (for want of any better ideas) and see what
> happens. In the meantime I just thought I'd share this one with yis.
> Any comments/suggestions appreciated.


P.S.

MySQL was one of that packages that was upgraded ... from 5.0.40
(worked) to 5.0.42 (above behaviour).

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 10:11 AM
nobrow@gmail.com
 
Posts: n/a
Default Re: Rows being matched during SELECT but not UPDATE

On Jul 8, 12:16 pm, nob...@gmail.com wrote:
> On Jul 8, 12:12 pm, nob...@gmail.com wrote:
>
>
>
> > How's this for an anomaly ...

>
> > mysql> SELECT * FROM clients WHERE username = 'aaa' AND pwd = 'bbb'
> > LIMIT 1;
> > <snip>
> > 1 row in set (0.00 sec)

>
> > mysql> UPDATE clients SET last_login = NOW() WHERE username = 'aaa'
> > AND pwd = 'bbb' LIMIT 1;
> > Query OK, 0 rows affected (0.01 sec)
> > Rows matched: 0 Changed: 0 Warnings: 0

>
> > The update no longer appears to find any matching rows. This has
> > worked perfectly for weeks. No changes were made to my code, but it
> > suddenly stopped working.

>
> > The only thing I can think of is that I upgraded a number of packages
> > on my system (Gentoo) over the last few days. Perhaps MySQL depends on
> > one of these packages for updates, but the above still looks pretty
> > implausible to me.

>
> > I'll rebuild MySQL (for want of any better ideas) and see what
> > happens. In the meantime I just thought I'd share this one with yis.
> > Any comments/suggestions appreciated.

>
> P.S.
>
> MySQL was one of that packages that was upgraded ... from 5.0.40
> (worked) to 5.0.42 (above behaviour).


Confirmed. Problem is only with the newer version. You think I should
post a bug report?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 10:11 AM
J.O. Aho
 
Posts: n/a
Default Re: Rows being matched during SELECT but not UPDATE

nobrow@gmail.com wrote:

>>> How's this for an anomaly ...
>>> mysql> SELECT * FROM clients WHERE username = 'aaa' AND pwd = 'bbb'
>>> LIMIT 1;
>>> <snip>
>>> 1 row in set (0.00 sec)
>>> mysql> UPDATE clients SET last_login = NOW() WHERE username = 'aaa'
>>> AND pwd = 'bbb' LIMIT 1;
>>> Query OK, 0 rows affected (0.01 sec)
>>> Rows matched: 0 Changed: 0 Warnings: 0
>>> The update no longer appears to find any matching rows. This has
>>> worked perfectly for weeks.

> Confirmed. Problem is only with the newer version. You think I should
> post a bug report?


I can't reproduce your "bug", did you restart mysqld after you emerged
the update?

You can run a "revdep-rebuild -- -p" to see if you have broken dependencies.


--

//Aho
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 10:11 AM
nobrow@gmail.com
 
Posts: n/a
Default Re: Rows being matched during SELECT but not UPDATE

On Jul 8, 1:00 pm, "J.O. Aho" <u...@example.net> wrote:
> nob...@gmail.com wrote:
> >>> How's this for an anomaly ...
> >>> mysql> SELECT * FROM clients WHERE username = 'aaa' AND pwd = 'bbb'
> >>> LIMIT 1;
> >>> <snip>
> >>> 1 row in set (0.00 sec)
> >>> mysql> UPDATE clients SET last_login = NOW() WHERE username = 'aaa'
> >>> AND pwd = 'bbb' LIMIT 1;
> >>> Query OK, 0 rows affected (0.01 sec)
> >>> Rows matched: 0 Changed: 0 Warnings: 0
> >>> The update no longer appears to find any matching rows. This has
> >>> worked perfectly for weeks.

> > Confirmed. Problem is only with the newer version. You think I should
> > post a bug report?

>
> I can't reproduce your "bug", did you restart mysqld after you emerged
> the update?
>
> You can run a "revdep-rebuild-- -p" to see if you have broken dependencies.
>
> --
>
> //Aho


Yes, I restarted MySQL.

I have a number of broken deps (below). The libcurl ones I know are
due to the last update ... the library is now libcurl.so.4. Dont know
about the libdb ones. But I think the important point is that the
output of revdep-rebuild is the same regardless of whether MySQL
5.0.40 or MySQL 5.0.42 is installed.

<snip>
Checking dynamic linking consistency...
broken /usr/bin/git-http-fetch (requires libcurl.so.3)
broken /usr/bin/git-http-push (requires libcurl.so.3)
broken /usr/lib/apache/modules/libssl.so (requires libdb-4.2.so)
broken /usr/lib/openoffice/program/libucpftp1.so (requires
libcurl.so.3)
broken /usr/lib/perl5/5.8.8/x86_64-linux/auto/DB_File/DB_File.so
(requires libdb-4.2.so)
broken /usr/lib64/apache/modules/libssl.so (requires libdb-4.2.so)
broken /usr/lib64/openoffice/program/libucpftp1.so (requires
libcurl.so.3)
broken /usr/lib64/perl5/5.8.8/x86_64-linux/auto/DB_File/DB_File.so
(requires libdb-4.2.so)
broken /usr/libexec/gpg2keys_curl (requires libcurl.so.3)
broken /usr/libexec/gpg2keys_hkp (requires libcurl.so.3)
<snip>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-28-2008, 10:11 AM
J.O. Aho
 
Posts: n/a
Default Re: Rows being matched during SELECT but not UPDATE

nobrow@gmail.com wrote:

> I have a number of broken deps (below). The libcurl ones I know are
> due to the last update ... the library is now libcurl.so.4. Dont know
> about the libdb ones. But I think the important point is that the
> output of revdep-rebuild is the same regardless of whether MySQL
> 5.0.40 or MySQL 5.0.42 is installed.


Regardless if 5.0.40 works with the broken dependency, before reporting any
bugs, see to fix those dependencies and rebuild the MySQL 5.0.42. There is a
habbit that newer versions may have more dependencies than older (shouldn't be
when patch levels are different, but only few do really honor the version giving).

I have tested your problem with 5.0.42 on most of my systems, as PowerPC
(32bit), Sparc (64bit), x86 and amd64 without being able to reproduce the
fault, which makes me to feel it's something wrong on your end and no on the
MySQL, of course I have quite limited features selected (berkdb perl ssl).



--

//Aho
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-28-2008, 10:11 AM
nobrow@gmail.com
 
Posts: n/a
Default Re: Rows being matched during SELECT but not UPDATE

On Jul 8, 3:37 pm, "J.O. Aho" <u...@example.net> wrote:
> nob...@gmail.com wrote:
> > I have a number of broken deps (below). The libcurl ones I know are
> > due to the last update ... the library is now libcurl.so.4. Dont know
> > about the libdb ones. But I think the important point is that the
> > output of revdep-rebuild is the same regardless of whether MySQL
> > 5.0.40 or MySQL 5.0.42 is installed.

>
> Regardless if 5.0.40 works with the broken dependency, before reporting any
> bugs, see to fix those dependencies and rebuild the MySQL 5.0.42. There is a
> habbit that newer versions may have more dependencies than older (shouldn't be
> when patch levels are different, but only few do really honor the version giving).
>
> I have tested your problem with 5.0.42 on most of my systems, as PowerPC
> (32bit), Sparc (64bit), x86 and amd64 without being able to reproduce the
> fault, which makes me to feel it's something wrong on your end and no on the
> MySQL, of course I have quite limited features selected (berkdb perl ssl).
>
> --
>
> //Aho


Fixed the dependency problems and rebuilt but no change.

I would be extremely doubtful that its really a bug in MySQL too ... I
mean its just so obvious that it couldnt avoid being caught by the
developers. But there must be some peculiar set of circumstances on my
machine that are causing this. Will just work with the old version for
now. Maybe the next release will work.

Thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-28-2008, 10:11 AM
J.O. Aho
 
Posts: n/a
Default Re: Rows being matched during SELECT but not UPDATE

nobrow@gmail.com wrote:
> On Jul 8, 3:37 pm, "J.O. Aho" <u...@example.net> wrote:


>> I have tested your problem with 5.0.42 on most of my systems, as PowerPC
>> (32bit), Sparc (64bit), x86 and amd64 without being able to reproduce the
>> fault, which makes me to feel it's something wrong on your end and no on the
>> MySQL, of course I have quite limited features selected (berkdb perl ssl).


> I would be extremely doubtful that its really a bug in MySQL too ... I
> mean its just so obvious that it couldnt avoid being caught by the
> developers. But there must be some peculiar set of circumstances on my
> machine that are causing this. Will just work with the old version for
> now. Maybe the next release will work.


what option have you enabled? "emerge -pv mysql", could be error related to
some of the features you enabled.

Another cause to strange things happening is if the CPU gets overheated, my
fan on the PowerPC machine broke once, it worked in day to day activity quite
well, but when compiling heavy ebuilds like glibc it got segfaults, took me a
while to notice that. The drawback with most x86 based CPUs is that they tend
to die quite quickly without proper cooling, of course there are exceptions,
like my old Athlon that was up in 129 degrees according the onboard sensors,
but that wasn't difficult to notice that something was wrong as the system was
extremely unstable.


--

//Aho
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:14 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com