PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » MDB2 » Bug #5930

Using notnull causes error

Details

Submitted2005-11-10 19:46 UTC
Fromrichtl at arscognita dot com
Assignedlsmith
StatusClosed
PackageMDB2
PHP Version5.1.0
OSLinux
Roadmaps(Not assigned)

Comments

[2005-11-10 19:46 UTC] richtl at arscognita dot com

Description:
------------
Compiling a schema that has "notnull" tags results in "MDB2 Error: unknown error". It works fine if I remove the <notnull> tag.

Environment is
MDB2 2.0.0beta6 beta
MDB2_Driver_mysql 0.1.1 beta
MDB2_Driver_mysqli 0.1.1 alpha
MDB2_Schema 0.2.0 beta

Test script:
---------------
<?xml version="1.0" ?>
<database>
<name>testdb</name>
<create>1</create>
<table>
<name>table1</name>
<declaration>
<field>
<name>field1</name>
<type>integer</type>
<notnull>1</notnull>
</field>
</declaration>
</table>
</database>

Expected result:
----------------
Schema generated successfully, field is not nullable.

Actual result:
--------------
Schema generates error "MDB2 Error: unknown error" and doesn't compile.

[2005-11-10 20:52 UTC] richtl at arscognita dot com

Working through it some more. setting <notnull>1</notnull> on my first field generates an error with the following (obviously broken) SQL:

CREATE TABLE Thought (thoughtId INT DEFAULT NULL NOT NULL,summary CHAR (255) DEFAULT NULL,detail TEXT DEFAULT NULL,status CHAR (16) DEFAULT NULL,interacted DATETIME DEFAULT NULL)]