phpliteadmin does not respect sqlite3 type affinity rules

Issue #171 resolved
Former user created an issue

Originally reported on Google Code with ID 171

What steps will reproduce the problem?

1. Create a table outside of phpliteadmin:
CREATE TABLE TEST (
    test_id integer NOT NULL PRIMARY KEY,
    test_value smallint NOT NULL
);
2. Try to insert a row into this table using phpliteadmin

What is the expected output? What do you see instead?
You cannot get the auto integer primary key behavior on the test_id, because you cannot
insert a default value for that column (if there was a way to omit that column from
the INSERT, sqlite would work correctly).  The smallint field shows up like a text
field (with a textarea) rather than an integer field (with an input type=text).

It seems that type comparisons are a little off in phpliteadmin.  Specifically, sometimes
it does case-sensitive comparisons on type name, and also it seems to ignore sqlite3's
type affinity rules (detailed in http://www.sqlite.org/datatype3.html section 2.1).

I have made a quick patch against 1.9.3.3 which addresses my issues.  I have not given
it a lot of testing in other scenarios (specifically I am concerned about BLOB behavior).

Reported by jeremydrake@eacceleration.com on 2013-02-08 00:52:46

<hr> * Attachment: phpliteadmin_type_affinity.patch

Comments (4)

  1. Christopher Kramer
    Thanks for your issue report and sorry for the late reply.
    
    Also thanks for your patch. Looks good at first sight.
    I will have a closer look at it and type handling in general.
    

    Reported by crazy4chrissi on 2013-02-22 21:11:52 - Status changed: Accepted

  2. Christopher Kramer
    Unfortunately I did not find the time for this to make it into 1.9.4.
    

    Reported by crazy4chrissi on 2013-03-18 01:22:55 - Labels added: Target-1.9.5 - Labels removed: Target-1.9.4

  3. Christopher Kramer
    I just fixed this issue with r447.
    

    Reported by crazy4chrissi on 2014-01-02 15:17:03 - Status changed: Fixed

  4. Log in to comment