dbd_sqlite3 has a discrepancy in how it treats integral primary key
fields.

sqlite> CREATE TABLE foo (id int(11) primary key);
sqlite> CREATE TABLE bar (id integer primary key);

when SELECTing from foo and bar with dbd_sqlite3, the
"find_result_field_types" function turns bar.id into
a LONGLONG.

  else if (strstr(curr_type, "BIGINT")
           || strstr(curr_type, "INTEGER PRIMARY KEY") /* BAD BAD HACK */
           || strstr(curr_type, "INT8")) {
    type = FIELD_TYPE_LONGLONG;
  }

I think that LONGLONG is incorrect for INTEGER PRIMARY KEY. It should
just be FIELD_TYPE_LONG.

In the "get_field_type" function, where there is

  if (curr_type) {
    if (pk_count == 1
        && (strcmp(curr_type, "INTEGER") == 0
            || strcmp(curr_type, "integer") == 0)) {
      free(curr_type);
      curr_type = strdup("INTEGER PRIMARY KEY");
    }
  }

int(N) is not handled.

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Libdbi-drivers-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libdbi-drivers-devel

Reply via email to