Unix Technical Forum

Simple query works on 5.0.24, fails on 5.0.32

This is a discussion on Simple query works on 5.0.24, fails on 5.0.32 within the MySQL forums, part of the Database Server Software category; --> I've got a program that's been working fine under MySQL 5.0.24. I ran it on a machine with 5.0.32 ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-03-2008, 02:50 PM
tmccune@yahoo-inc.com
 
Posts: n/a
Default Simple query works on 5.0.24, fails on 5.0.32

I've got a program that's been working fine under MySQL 5.0.24. I ran
it on a machine with 5.0.32 installed, and it started failing. I've
narrowed the problem down to this simple test case:

create table A (id bigint);
create table B (id bigint, b varchar(255), c bigint);
insert into A values (1);
insert into B values (1, 'X', 1);
select * from A a where 'X' in (select b.b from B b where a.id=b.c);

Under 5.0.24, this returns 1 row. Under 5.0.32, this returns 0 rows.

I'm baffled.

Any suggestions?

Thanks.

--Tim
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-03-2008, 02:50 PM
Captain Paralytic
 
Posts: n/a
Default Re: Simple query works on 5.0.24, fails on 5.0.32

On 31 Mar, 10:36, "tmcc...@yahoo-inc.com" <ksuwild...@gmail.com>
wrote:
> I've got a program that's been working fine under MySQL 5.0.24. I ran
> it on a machine with 5.0.32 installed, and it started failing. I've
> narrowed the problem down to this simple test case:
>
> create table A (id bigint);
> create table B (id bigint, b varchar(255), c bigint);
> insert into A values (1);
> insert into B values (1, 'X', 1);
> select * from A a where 'X' in (select b.b from B b where a.id=b.c);
>
> Under 5.0.24, this returns 1 row. Under 5.0.32, this returns 0 rows.
>
> I'm baffled.
>
> Any suggestions?
>
> Thanks.
>
> --Tim


I don't have that version available at the moment, but surely
SELECT
a.*
FROM A a
JOIN B b ON a.id = b.c AND b.b = 'X'
is a better way to achieve this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-03-2008, 02:50 PM
tmccune@yahoo-inc.com
 
Posts: n/a
Default Re: Simple query works on 5.0.24, fails on 5.0.32

On Mar 31, 6:29 am, Captain Paralytic <paul_laut...@yahoo.com> wrote:
>
> I don't have that version available at the moment, but surely
> SELECT
> a.*
> FROM A a
> JOIN B b ON a.id = b.c AND b.b = 'X'
> is a better way to achieve this.


Thanks for the reply. Sure, but this SQL is being generated by an ORM
tool (Hibernate), so I don't have control over the SQL that it
generates. Rather than "don't do that", I'd really like to know why
such a simple query stopped working.
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 12:16 AM.


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