Forums » General Discussion

Thread: null fields in select

This question is not answered. Helpful answers available: 2. Answered answers available: 1.


Permlink Replies: 1 - Pages: 1 - Last Post: Jun 8, 2012 6:37 AM by: golimar
golimar

Posts: 7
Registered: 11/3/11
null fields in select
Posted: Feb 27, 2012 10:44 AM
 
  Click to reply to this thread Reply

This query shows some fields as null values, but that's not the real value (I tested it on Mysql Query Browser), and it only happens on some columns, and only on some of the returned rows

This is the description of the returned rows:
- the first 34 rows are displayed correctly
- 2 rows without match (their id appears in the left side of the outer join, but not on the right side) , so the fields corresponding to tf2.circuitos are null
- the rest of the rows show the last four fields of the tf2.circuitos table as null (these are the ones that show correctly on Mysql Query Browser)

The export to Excel is ok however, and also if I place an ORDER BY, forcing the 2 null rows to appear at the end, the other rows are ok. If I place them first, all the rest of the rows appear as null

The query:
select * from tf.xc1641_pasarela_ids left join tf2.circuitos on output_circuitoid=circuitoid
where (circuitoid is null or (antiguo and not nuevo)) and facilidad not in
(select facilidad from xc1641_pasarela_ids); -- 94


Tested in versions:
5.0.0.345
6.0.1.1723


golimar

Posts: 7
Registered: 11/3/11
Re: null fields in select
Posted: Jun 8, 2012 6:37 AM   in response to: golimar
 
  Click to reply to this thread Reply

Further research shows that it only happens when the field is shown as a checkbox (it's a BOOL field in my tables). If I change the field type to INT it works fine (it's shown as 0, 1 or null).

This problem can be found in these versions:
5.0.0.345
6.0.1.1723
6.3.0.642


Legend
Guru: 2001 + pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums