Menu

#19 Alias problem with text fields

closed
nobody
None
5
2002-02-19
2002-01-31
No

I have a test table in db sl called test with two
fields comp (type int) and tval (type text). There are
7 records with values 1-7 for comp and NULL values for
text (at present). The following queries work:
select comp,tval from test;
select t.comp from test as t;
however
select t.comp,t.tval from test as t; returns an error
with phpMyAdmin2.2.0 namely
SHOW FIELDS FROM `sl`.`t` LIKE `tval`
MySQL said:
Table `sl`.`t` eoesn't exist

However If I change the field type of tval to VARCHAR
(100) then it does work as expected. Using the TEXT
field type seems to upset things. Is this a bug? Is
there a work around (other than not using aliases). In
the real app there are quite a few fields and it would
be very tedious not to be able to use them.
PS using MyODBC with FileMaker Pro also gives an
error. However it works if you type in at the command
line in MySQL.

Discussion

  • Robin Newman

    Robin Newman - 2002-02-02

    Logged In: YES
    user_id=444998

    To answer my own query, it appears that the problem is in
    having the text fields defined as initially NULL. If the
    are defined as NOT NULL but containing an empty string then
    everything works OK.
    Still doesn;t explain why MyPHPAdmin behaves as it does.

     
  • Loïc Chapeaux

    Loïc Chapeaux - 2002-02-09

    Logged In: YES
    user_id=144058

    Hi!

    I can't reproduce this bug with the current cvs version of
    phpMyAdmin. Could you upgrade at least to the 2.2.3 release
    (2.2.0 is quite old)?

    Loc

     
  • Loïc Chapeaux

    Loïc Chapeaux - 2002-02-19
    • status: open --> closed