Professional Web Applications Themes

Rows being matched during SELECT but not UPDATE - MySQL

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

  1. #1

    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.

    nobrow@gmail.com Guest

  2. #2

    Default Re: Rows being matched during SELECT but not UPDATE

    On Jul 8, 12:12 pm, com wrote: 

    P.S.

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

    nobrow@gmail.com Guest

  3. #3

    Default Re: Rows being matched during SELECT but not UPDATE

    On Jul 8, 12:16 pm, com wrote: 





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

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

    nobrow@gmail.com Guest

  4. #4

    Default Re: Rows being matched during SELECT but not UPDATE

    com wrote:
     [/ref]
    > Confirmed. Problem is only with the newer version. You think I should
    > post a bug report?[/ref]

    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
    J.O. Guest

  5. #5

    Default Re: Rows being matched during SELECT but not UPDATE

    On Jul 8, 1:00 pm, "J.O. Aho" <net> wrote: 
    > > Confirmed. Problem is only with the newer version. You think I should
    > > post a bug report?[/ref]
    >
    > 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[/ref]

    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>

    nobrow@gmail.com Guest

  6. #6

    Default Re: Rows being matched during SELECT but not UPDATE

    com wrote:
     

    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
    J.O. Guest

  7. #7

    Default Re: Rows being matched during SELECT but not UPDATE

    On Jul 8, 3:37 pm, "J.O. Aho" <net> wrote: 
    >
    > 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[/ref]

    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 cirstances on my
    machine that are causing this. Will just work with the old version for
    now. Maybe the next release will work.

    Thanks.

    nobrow@gmail.com Guest

  8. #8

    Default Re: Rows being matched during SELECT but not UPDATE

    com wrote: 
     [/ref]
     

    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
    J.O. Guest

Similar Threads

  1. How to select first 50 rows?
    By miyaki in forum Informix
    Replies: 4
    Last Post: October 29th, 02:01 PM
  2. Select the rows which are implicated in an not committed update command
    By Lucian in forum Microsoft SQL / MS SQL Server
    Replies: 5
    Last Post: July 13th, 09:37 PM
  3. Select rows where other related rows don't exist
    By Dmand in forum Microsoft SQL / MS SQL Server
    Replies: 2
    Last Post: July 2nd, 06:23 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139