Professional Web Applications Themes

#46212 [NEW]: SQLite3::exec() with a valid CREATE TABLE fails - PHP Bugs

From: kristof dot coomans at telenet dot be Operating system: Windows XP PHP version: 5.3CVS-2008-10-01 (snap) PHP Bug Type: SQLite related Bug description: SQLite3::exec() with a valid CREATE TABLE fails Description: ------------ SQLite3::exec with valid query fails with the error message "SQL logic error or missing database". Actually testing with http://snaps.php.net/win32/php5.3-win32-200809251104.zip since there is no snapshot for win32 yet for today. Reproduce code: --------------- <?php unlink( 'test.sqlite3.db' ); $cn = new SQLite3( 'test.sqlite3.db' ); $sql = "CREATE TABLE ezcontentclass_attribute ( can_translate INTEGER(11) DEFAULT '1', contentclass_id INTEGER(11) NOT NULL DEFAULT '0', data_float1 float DEFAULT NULL, data_float2 float DEFAULT NULL, data_float3 float ...

  1. #1

    Default #46212 [NEW]: SQLite3::exec() with a valid CREATE TABLE fails

    From: kristof dot coomans at telenet dot be
    Operating system: Windows XP
    PHP version: 5.3CVS-2008-10-01 (snap)
    PHP Bug Type: SQLite related
    Bug description: SQLite3::exec() with a valid CREATE TABLE fails

    Description:
    ------------
    SQLite3::exec with valid query fails with the error message "SQL logic
    error or missing database".

    Actually testing with
    http://snaps.php.net/win32/php5.3-win32-200809251104.zip since there is no
    snapshot for win32 yet for today.

    Reproduce code:
    ---------------
    <?php

    unlink( 'test.sqlite3.db' );
    $cn = new SQLite3( 'test.sqlite3.db' );

    $sql = "CREATE TABLE ezcontentclass_attribute (
    can_translate INTEGER(11) DEFAULT '1',
    contentclass_id INTEGER(11) NOT NULL DEFAULT '0',
    data_float1 float DEFAULT NULL,
    data_float2 float DEFAULT NULL,
    data_float3 float DEFAULT NULL,
    data_float4 float DEFAULT NULL,
    data_int1 INTEGER(11) DEFAULT NULL,
    data_int2 INTEGER(11) DEFAULT NULL,
    data_int3 INTEGER(11) DEFAULT NULL,
    data_text1 varchar(50) DEFAULT NULL,
    data_text2 varchar(50) DEFAULT NULL,
    data_text3 varchar(50) DEFAULT NULL,
    data_text5 longtext,
    data_type_string varchar(50) NOT NULL DEFAULT '',
    id INTEGER,
    identifier varchar(50) NOT NULL DEFAULT '',
    is_information_collector INTEGER(11) NOT NULL DEFAULT '0',
    is_required INTEGER(11) NOT NULL DEFAULT '0',
    is_searchable INTEGER(11) NOT NULL DEFAULT '0',
    placement INTEGER(11) NOT NULL DEFAULT '0',
    serialized_name_list longtext NOT NULL,
    version INTEGER(11) NOT NULL DEFAULT '0',
    PRIMARY KEY ( id, version )
    )";

    $succes = $cn->exec( $sql );

    if ( !$succes )
    {
    print( "Error " . $cn->lastErrorCode() . ": " . $cn->lastErrorMsg() .
    PHP_EOL );
    }

    ?>

    Expected result:
    ----------------
    The script should finish without any warnings.

    Executing the sql with the sqlite3 command line client works fine.

    Actual result:
    --------------
    Error 1: SQL logic error or missing database

    --
    Edit bug report at http://bugs.php.net/?id=46212&edit=1
    --
    Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46212&r=trysnapshot52
    Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46212&r=trysnapshot53
    Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46212&r=trysnapshot60
    Fixed in CVS: http://bugs.php.net/fix.php?id=46212&r=fixedcvs
    Fixed in release: http://bugs.php.net/fix.php?id=46212&r=alreadyfixed
    Need backtrace: http://bugs.php.net/fix.php?id=46212&r=needtrace
    Need Reproduce Script: http://bugs.php.net/fix.php?id=46212&r=needscript
    Try newer version: http://bugs.php.net/fix.php?id=46212&r=oldversion
    Not developer issue: http://bugs.php.net/fix.php?id=46212&r=support
    Expected behavior: http://bugs.php.net/fix.php?id=46212&r=notwrong
    Not enough info: http://bugs.php.net/fix.php?id=46212&r=notenoughinfo
    Submitted twice: http://bugs.php.net/fix.php?id=46212&r=submittedtwice
    register_globals: http://bugs.php.net/fix.php?id=46212&r=globals
    PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46212&r=php4
    Daylight Savings: http://bugs.php.net/fix.php?id=46212&r=dst
    IIS Stability: http://bugs.php.net/fix.php?id=46212&r=isapi
    Install GNU Sed: http://bugs.php.net/fix.php?id=46212&r=gnused
    Floating point limitations: http://bugs.php.net/fix.php?id=46212&r=float
    No Zend Extensions: http://bugs.php.net/fix.php?id=46212&r=nozend
    MySQL Configuration Error: http://bugs.php.net/fix.php?id=46212&r=mysqlcfg

    kristof Guest

  2. #2

    Default #46212 [Opn->Asn]: SQLite3::exec() with a valid CREATE TABLE fails

    ID: 46212
    Updated by: net
    Reported By: kristof dot coomans at telenet dot be
    -Status: Open
    +Status: Assigned
    Bug Type: SQLite related
    Operating System: Windows XP
    PHP Version: 5.3CVS-2008-10-01 (snap)
    -Assigned To:
    +Assigned To: scottmac
    New Comment:

    This works on Linux and Mac but not Windows.


    Previous Comments:
    ------------------------------------------------------------------------

    [2008-10-01 15:37:08] kristof dot coomans at telenet dot be

    Description:
    ------------
    SQLite3::exec with valid query fails with the error message "SQL logic
    error or missing database".

    Actually testing with
    http://snaps.php.net/win32/php5.3-win32-200809251104.zip since there is
    no snapshot for win32 yet for today.

    Reproduce code:
    ---------------
    <?php

    unlink( 'test.sqlite3.db' );
    $cn = new SQLite3( 'test.sqlite3.db' );

    $sql = "CREATE TABLE ezcontentclass_attribute (
    can_translate INTEGER(11) DEFAULT '1',
    contentclass_id INTEGER(11) NOT NULL DEFAULT '0',
    data_float1 float DEFAULT NULL,
    data_float2 float DEFAULT NULL,
    data_float3 float DEFAULT NULL,
    data_float4 float DEFAULT NULL,
    data_int1 INTEGER(11) DEFAULT NULL,
    data_int2 INTEGER(11) DEFAULT NULL,
    data_int3 INTEGER(11) DEFAULT NULL,
    data_text1 varchar(50) DEFAULT NULL,
    data_text2 varchar(50) DEFAULT NULL,
    data_text3 varchar(50) DEFAULT NULL,
    data_text5 longtext,
    data_type_string varchar(50) NOT NULL DEFAULT '',
    id INTEGER,
    identifier varchar(50) NOT NULL DEFAULT '',
    is_information_collector INTEGER(11) NOT NULL DEFAULT '0',
    is_required INTEGER(11) NOT NULL DEFAULT '0',
    is_searchable INTEGER(11) NOT NULL DEFAULT '0',
    placement INTEGER(11) NOT NULL DEFAULT '0',
    serialized_name_list longtext NOT NULL,
    version INTEGER(11) NOT NULL DEFAULT '0',
    PRIMARY KEY ( id, version )
    )";

    $succes = $cn->exec( $sql );

    if ( !$succes )
    {
    print( "Error " . $cn->lastErrorCode() . ": " . $cn->lastErrorMsg()
    .. PHP_EOL );
    }

    ?>

    Expected result:
    ----------------
    The script should finish without any warnings.

    Executing the sql with the sqlite3 command line client works fine.

    Actual result:
    --------------
    Error 1: SQL logic error or missing database


    ------------------------------------------------------------------------


    --
    Edit this bug report at http://bugs.php.net/?id=46212&edit=1

    scottmac@php.net Guest

  3. #3

    Default #46212 [Asn]: SQLite3::exec() with a valid CREATE TABLE fails

    ID: 46212
    Updated by: net
    Reported By: kristof dot coomans at telenet dot be
    Status: Assigned
    Bug Type: SQLite related
    Operating System: Windows XP
    PHP Version: 5.3CVS-2008-10-01 (snap)
    Assigned To: scottmac
    New Comment:

    Does the user you're running the script as have permission to write the
    database file and the directory the script is in?

    That's usually the reason for this sort of error.


    Previous Comments:
    ------------------------------------------------------------------------

    [2008-10-01 15:56:11] net

    This works on Linux and Mac but not Windows.

    ------------------------------------------------------------------------

    [2008-10-01 15:37:08] kristof dot coomans at telenet dot be

    Description:
    ------------
    SQLite3::exec with valid query fails with the error message "SQL logic
    error or missing database".

    Actually testing with
    http://snaps.php.net/win32/php5.3-win32-200809251104.zip since there is
    no snapshot for win32 yet for today.

    Reproduce code:
    ---------------
    <?php

    unlink( 'test.sqlite3.db' );
    $cn = new SQLite3( 'test.sqlite3.db' );

    $sql = "CREATE TABLE ezcontentclass_attribute (
    can_translate INTEGER(11) DEFAULT '1',
    contentclass_id INTEGER(11) NOT NULL DEFAULT '0',
    data_float1 float DEFAULT NULL,
    data_float2 float DEFAULT NULL,
    data_float3 float DEFAULT NULL,
    data_float4 float DEFAULT NULL,
    data_int1 INTEGER(11) DEFAULT NULL,
    data_int2 INTEGER(11) DEFAULT NULL,
    data_int3 INTEGER(11) DEFAULT NULL,
    data_text1 varchar(50) DEFAULT NULL,
    data_text2 varchar(50) DEFAULT NULL,
    data_text3 varchar(50) DEFAULT NULL,
    data_text5 longtext,
    data_type_string varchar(50) NOT NULL DEFAULT '',
    id INTEGER,
    identifier varchar(50) NOT NULL DEFAULT '',
    is_information_collector INTEGER(11) NOT NULL DEFAULT '0',
    is_required INTEGER(11) NOT NULL DEFAULT '0',
    is_searchable INTEGER(11) NOT NULL DEFAULT '0',
    placement INTEGER(11) NOT NULL DEFAULT '0',
    serialized_name_list longtext NOT NULL,
    version INTEGER(11) NOT NULL DEFAULT '0',
    PRIMARY KEY ( id, version )
    )";

    $succes = $cn->exec( $sql );

    if ( !$succes )
    {
    print( "Error " . $cn->lastErrorCode() . ": " . $cn->lastErrorMsg()
    .. PHP_EOL );
    }

    ?>

    Expected result:
    ----------------
    The script should finish without any warnings.

    Executing the sql with the sqlite3 command line client works fine.

    Actual result:
    --------------
    Error 1: SQL logic error or missing database


    ------------------------------------------------------------------------


    --
    Edit this bug report at http://bugs.php.net/?id=46212&edit=1

    scottmac@php.net Guest

  4. #4

    Default #46212 [Asn]: SQLite3::exec() with a valid CREATE TABLE fails

    ID: 46212
    User updated by: kristof dot coomans at telenet dot be
    Reported By: kristof dot coomans at telenet dot be
    Status: Assigned
    Bug Type: SQLite related
    Operating System: Windows XP
    PHP Version: 5.3CVS-2008-10-01 (snap)
    Assigned To: scottmac
    New Comment:

    Yes, the user has permission to read & write to the directory & file.


    Previous Comments:
    ------------------------------------------------------------------------

    [2008-10-01 15:58:12] net

    Does the user you're running the script as have permission to write the
    database file and the directory the script is in?

    That's usually the reason for this sort of error.

    ------------------------------------------------------------------------

    [2008-10-01 15:56:11] net

    This works on Linux and Mac but not Windows.

    ------------------------------------------------------------------------

    [2008-10-01 15:37:08] kristof dot coomans at telenet dot be

    Description:
    ------------
    SQLite3::exec with valid query fails with the error message "SQL logic
    error or missing database".

    Actually testing with
    http://snaps.php.net/win32/php5.3-win32-200809251104.zip since there is
    no snapshot for win32 yet for today.

    Reproduce code:
    ---------------
    <?php

    unlink( 'test.sqlite3.db' );
    $cn = new SQLite3( 'test.sqlite3.db' );

    $sql = "CREATE TABLE ezcontentclass_attribute (
    can_translate INTEGER(11) DEFAULT '1',
    contentclass_id INTEGER(11) NOT NULL DEFAULT '0',
    data_float1 float DEFAULT NULL,
    data_float2 float DEFAULT NULL,
    data_float3 float DEFAULT NULL,
    data_float4 float DEFAULT NULL,
    data_int1 INTEGER(11) DEFAULT NULL,
    data_int2 INTEGER(11) DEFAULT NULL,
    data_int3 INTEGER(11) DEFAULT NULL,
    data_text1 varchar(50) DEFAULT NULL,
    data_text2 varchar(50) DEFAULT NULL,
    data_text3 varchar(50) DEFAULT NULL,
    data_text5 longtext,
    data_type_string varchar(50) NOT NULL DEFAULT '',
    id INTEGER,
    identifier varchar(50) NOT NULL DEFAULT '',
    is_information_collector INTEGER(11) NOT NULL DEFAULT '0',
    is_required INTEGER(11) NOT NULL DEFAULT '0',
    is_searchable INTEGER(11) NOT NULL DEFAULT '0',
    placement INTEGER(11) NOT NULL DEFAULT '0',
    serialized_name_list longtext NOT NULL,
    version INTEGER(11) NOT NULL DEFAULT '0',
    PRIMARY KEY ( id, version )
    )";

    $succes = $cn->exec( $sql );

    if ( !$succes )
    {
    print( "Error " . $cn->lastErrorCode() . ": " . $cn->lastErrorMsg()
    .. PHP_EOL );
    }

    ?>

    Expected result:
    ----------------
    The script should finish without any warnings.

    Executing the sql with the sqlite3 command line client works fine.

    Actual result:
    --------------
    Error 1: SQL logic error or missing database


    ------------------------------------------------------------------------


    --
    Edit this bug report at http://bugs.php.net/?id=46212&edit=1

    kristof Guest

  5. #5

    Default #46212 [Asn->Fbk]: SQLite3::exec() with a valid CREATE TABLE fails

    ID: 46212
    Updated by: net
    Reported By: kristof dot coomans at telenet dot be
    -Status: Assigned
    +Status: Feedback
    Bug Type: SQLite related
    Operating System: Windows XP
    PHP Version: 5.3CVS-2008-10-01 (snap)
    Assigned To: scottmac
    New Comment:

    Can you try a 5.3 snapshot from http://windows.php.net/snapshots/

    I think this could be optimisation related and recently fixed.


    Previous Comments:
    ------------------------------------------------------------------------

    [2008-10-01 16:25:40] kristof dot coomans at telenet dot be

    Yes, the user has permission to read & write to the directory & file.

    ------------------------------------------------------------------------

    [2008-10-01 15:58:12] net

    Does the user you're running the script as have permission to write the
    database file and the directory the script is in?

    That's usually the reason for this sort of error.

    ------------------------------------------------------------------------

    [2008-10-01 15:56:11] net

    This works on Linux and Mac but not Windows.

    ------------------------------------------------------------------------

    [2008-10-01 15:37:08] kristof dot coomans at telenet dot be

    Description:
    ------------
    SQLite3::exec with valid query fails with the error message "SQL logic
    error or missing database".

    Actually testing with
    http://snaps.php.net/win32/php5.3-win32-200809251104.zip since there is
    no snapshot for win32 yet for today.

    Reproduce code:
    ---------------
    <?php

    unlink( 'test.sqlite3.db' );
    $cn = new SQLite3( 'test.sqlite3.db' );

    $sql = "CREATE TABLE ezcontentclass_attribute (
    can_translate INTEGER(11) DEFAULT '1',
    contentclass_id INTEGER(11) NOT NULL DEFAULT '0',
    data_float1 float DEFAULT NULL,
    data_float2 float DEFAULT NULL,
    data_float3 float DEFAULT NULL,
    data_float4 float DEFAULT NULL,
    data_int1 INTEGER(11) DEFAULT NULL,
    data_int2 INTEGER(11) DEFAULT NULL,
    data_int3 INTEGER(11) DEFAULT NULL,
    data_text1 varchar(50) DEFAULT NULL,
    data_text2 varchar(50) DEFAULT NULL,
    data_text3 varchar(50) DEFAULT NULL,
    data_text5 longtext,
    data_type_string varchar(50) NOT NULL DEFAULT '',
    id INTEGER,
    identifier varchar(50) NOT NULL DEFAULT '',
    is_information_collector INTEGER(11) NOT NULL DEFAULT '0',
    is_required INTEGER(11) NOT NULL DEFAULT '0',
    is_searchable INTEGER(11) NOT NULL DEFAULT '0',
    placement INTEGER(11) NOT NULL DEFAULT '0',
    serialized_name_list longtext NOT NULL,
    version INTEGER(11) NOT NULL DEFAULT '0',
    PRIMARY KEY ( id, version )
    )";

    $succes = $cn->exec( $sql );

    if ( !$succes )
    {
    print( "Error " . $cn->lastErrorCode() . ": " . $cn->lastErrorMsg()
    .. PHP_EOL );
    }

    ?>

    Expected result:
    ----------------
    The script should finish without any warnings.

    Executing the sql with the sqlite3 command line client works fine.

    Actual result:
    --------------
    Error 1: SQL logic error or missing database


    ------------------------------------------------------------------------


    --
    Edit this bug report at http://bugs.php.net/?id=46212&edit=1

    scottmac@php.net Guest

  6. #6

    Default #46212 [Fbk->Opn]: SQLite3::exec() with a valid CREATE TABLE fails

    ID: 46212
    User updated by: kristof dot coomans at telenet dot be
    Reported By: kristof dot coomans at telenet dot be
    -Status: Feedback
    +Status: Open
    Bug Type: SQLite related
    Operating System: Windows XP
    PHP Version: 5.3CVS-2008-10-01 (snap)
    Assigned To: scottmac
    New Comment:

    Yes, it works again as expected with the last snapshot I downloaded.
    Thanks!


    Previous Comments:
    ------------------------------------------------------------------------

    [2008-10-20 23:58:36] net

    Can you try a 5.3 snapshot from http://windows.php.net/snapshots/

    I think this could be optimisation related and recently fixed.

    ------------------------------------------------------------------------

    [2008-10-01 16:25:40] kristof dot coomans at telenet dot be

    Yes, the user has permission to read & write to the directory & file.

    ------------------------------------------------------------------------

    [2008-10-01 15:58:12] net

    Does the user you're running the script as have permission to write the
    database file and the directory the script is in?

    That's usually the reason for this sort of error.

    ------------------------------------------------------------------------

    [2008-10-01 15:56:11] net

    This works on Linux and Mac but not Windows.

    ------------------------------------------------------------------------

    [2008-10-01 15:37:08] kristof dot coomans at telenet dot be

    Description:
    ------------
    SQLite3::exec with valid query fails with the error message "SQL logic
    error or missing database".

    Actually testing with
    http://snaps.php.net/win32/php5.3-win32-200809251104.zip since there is
    no snapshot for win32 yet for today.

    Reproduce code:
    ---------------
    <?php

    unlink( 'test.sqlite3.db' );
    $cn = new SQLite3( 'test.sqlite3.db' );

    $sql = "CREATE TABLE ezcontentclass_attribute (
    can_translate INTEGER(11) DEFAULT '1',
    contentclass_id INTEGER(11) NOT NULL DEFAULT '0',
    data_float1 float DEFAULT NULL,
    data_float2 float DEFAULT NULL,
    data_float3 float DEFAULT NULL,
    data_float4 float DEFAULT NULL,
    data_int1 INTEGER(11) DEFAULT NULL,
    data_int2 INTEGER(11) DEFAULT NULL,
    data_int3 INTEGER(11) DEFAULT NULL,
    data_text1 varchar(50) DEFAULT NULL,
    data_text2 varchar(50) DEFAULT NULL,
    data_text3 varchar(50) DEFAULT NULL,
    data_text5 longtext,
    data_type_string varchar(50) NOT NULL DEFAULT '',
    id INTEGER,
    identifier varchar(50) NOT NULL DEFAULT '',
    is_information_collector INTEGER(11) NOT NULL DEFAULT '0',
    is_required INTEGER(11) NOT NULL DEFAULT '0',
    is_searchable INTEGER(11) NOT NULL DEFAULT '0',
    placement INTEGER(11) NOT NULL DEFAULT '0',
    serialized_name_list longtext NOT NULL,
    version INTEGER(11) NOT NULL DEFAULT '0',
    PRIMARY KEY ( id, version )
    )";

    $succes = $cn->exec( $sql );

    if ( !$succes )
    {
    print( "Error " . $cn->lastErrorCode() . ": " . $cn->lastErrorMsg()
    .. PHP_EOL );
    }

    ?>

    Expected result:
    ----------------
    The script should finish without any warnings.

    Executing the sql with the sqlite3 command line client works fine.

    Actual result:
    --------------
    Error 1: SQL logic error or missing database


    ------------------------------------------------------------------------


    --
    Edit this bug report at http://bugs.php.net/?id=46212&edit=1

    kristof Guest

  7. #7

    Default #46212 [Opn->Csd]: SQLite3::exec() with a valid CREATE TABLE fails

    ID: 46212
    Updated by: net
    Reported By: kristof dot coomans at telenet dot be
    -Status: Open
    +Status: Closed
    Bug Type: SQLite related
    Operating System: Windows XP
    PHP Version: 5.3CVS-2008-10-01 (snap)
    Assigned To: scottmac


    Previous Comments:
    ------------------------------------------------------------------------

    [2008-10-23 07:59:51] kristof dot coomans at telenet dot be

    Yes, it works again as expected with the last snapshot I downloaded.
    Thanks!

    ------------------------------------------------------------------------

    [2008-10-20 23:58:36] net

    Can you try a 5.3 snapshot from http://windows.php.net/snapshots/

    I think this could be optimisation related and recently fixed.

    ------------------------------------------------------------------------

    [2008-10-01 16:25:40] kristof dot coomans at telenet dot be

    Yes, the user has permission to read & write to the directory & file.

    ------------------------------------------------------------------------

    [2008-10-01 15:58:12] net

    Does the user you're running the script as have permission to write the
    database file and the directory the script is in?

    That's usually the reason for this sort of error.

    ------------------------------------------------------------------------

    [2008-10-01 15:56:11] net

    This works on Linux and Mac but not Windows.

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://bugs.php.net/46212

    --
    Edit this bug report at http://bugs.php.net/?id=46212&edit=1

    scottmac@php.net Guest

Similar Threads

  1. #25837 [NEW]: var-exports fails to produce valid PHP in some cases
    By manu at chasqui dot cu in forum PHP Development
    Replies: 0
    Last Post: October 11th, 02:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139