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_Driver_mssql » Bug #8347

Create Table Error

Details

Submitted2006-08-02 12:31 UTC
Fromdecombe at unisolution dot de
Assignedlsmith
StatusClosed
PackageMDB2_Driver_mssql
PHP Version4.3.8
OSLinux
Roadmaps(Not assigned)

Comments

[2006-08-02 12:31 UTC] decombe at unisolution dot de

Description:
------------
Hi,

I create tables with MDB2. My Script does work with Mysql and Pgsql. I launched today the script with a SQL Server. It does not work.
it comes a error message after creating a table.

The table is created but MDB2 gives back an error. (see below). Could you tell me what's wrong.

Test script:
---------------
$result = $this->db->manager->createTable($tables,$table['fields']);
if (PEAR::isError($result)){
echo newLine(1)."<b>CREATE TABLE ERROR</b>".newLine(1);
echo $result->message.'<br/>'.$result->userinfo;
exit;
}

Actual result:
--------------
[backtrace] => Array
(
[0] => Array
(
[file] => /srv/www/php/php-4.3.10/lib/php/MDB2.php
[line] => 951
[function] => pear_error
[class] => mdb2_error
[type] => ->
[args] => Array
(
[0] => MDB2 Error: Array
[1] =>
[2] => 1
[3] => 1024
[4] => [Error message: _doQuery: Could not execute statement]
[Last query: CREATE TABLE system_version (version_id VARCHAR(20) DEFAULT ' ' NOT NULL, version_number VARCHAR(10) DEFAULT ' ' NOT NULL)]
[Native code: 0]

)

)

[1] => Array
(
[file] => /srv/www/php/php-4.3.10/lib/php/PEAR.php
[line] => 563
[function] => mdb2_error
[class] => mdb2_error
[type] => ->
[args] => Array
(
[0] =>
[1] => 1
[2] => 1024
[3] => [Error message: _doQuery: Could not execute statement]
[Last query: CREATE TABLE system_version (version_id VARCHAR(20) DEFAULT ' ' NOT NULL, version_number VARCHAR(10) DEFAULT ' ' NOT NULL)]
[Native code: 0]

)

)

[2] => Array
(
[file] => /srv/www/php/php-4.3.10/lib/php/MDB2.php
[line] => 1403
[function] => raiseerror
[class] => pear
[type] => ::
[args] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] => [Error message: _doQuery: Could not execute statement]
[Last query: CREATE TABLE system_version (version_id VARCHAR(20) DEFAULT ' ' NOT NULL, version_number VARCHAR(10) DEFAULT ' ' NOT NULL)]
[Native code: 0]

[5] => MDB2_Error
[6] => 1
)

)

[3] => Array
(
[file] => /srv/www/php/php-4.3.10/lib/php/MDB2/Driver/mssql.php
[line] => 388
[function] => raiseerror
[class] => mdb2_driver_mssql
[type] => ->
[args] => Array
(
[0] =>
[1] =>
[2] =>
[3] => _doQuery: Could not execute statement
)

)

[4] => Array
(
[file] => /srv/www/php/php-4.3.10/lib/php/MDB2.php
[line] => 2427
[function] => _doquery
[class] => mdb2_driver_mssql
[type] => ->
[args] => Array
(
[0] => CREATE TABLE system_version (version_id VARCHAR(20) DEFAULT ' ' NOT NULL, version_number VARCHAR(10) DEFAULT ' ' NOT NULL)
[1] => 1
[2] => Resource id #12
[3] => [MoveinOnlineTest]
)

)

[5] => Array
(
[file] => /srv/www/php/php-4.3.10/lib/php/MDB2/Driver/Manager/Common.php
[line] => 257
[function] => exec
[class] => mdb2_driver_mssql
[type] => ->
[args] => Array
(
[0] => CREATE TABLE system_version (version_id VARCHAR(20) DEFAULT ' ' NOT NULL, version_number VARCHAR(10) DEFAULT ' ' NOT NULL)
)

)

[6] => Array
(
[file] => /srv/www/htdocs/movein/local/move/libraries/setup/setup.class.php
[line] => 340
[function] => createtable
[class] => mdb2_driver_manager_mssql
[type] => ->
[args] => Array
(
[0] => system_version
[1] => Array
(
[version_id] => Array
(
[type] => text
[length] => 20
[notnull] => 1
[default] =>
[was] => version_id
)

[version_number] => Array
(
[type] => text
[length] => 10
[notnull] => 1
[default] =>
[was] => version_number
)

)

)

)

[7] => Array
(
[file] => /srv/www/htdocs/movein/local/move/libraries/setup/setup.class.php
[line] => 432
[function] => createtables
[class] => setup
[type] => ->
[args] => Array
(
[0] => Array
(
[type] => move
[file_def] => ../../libraries/setup/move_schema.xml
[version] => 531
[init_values] => init_movein
)

)

)

[8] => Array
(
[file] => /srv/www/htdocs/movein/local/move/libraries/setup/setup.class.php
[line] => 62
[function] => init
[class] => setup
[type] => ->
[args] => Array
(
)

)

[9] => Array
(
[file] => /srv/www/htdocs/movein/local/move/libraries/setup/setup.class.php
[line] => 40
[function] => printinit
[class] => setup
[type] => ->
[args] => Array
(
)

)

[10] => Array
(
[file] => /srv/www/htdocs/movein/local/move/movein/setup/setup.php
[line] => 18
[function] => printpage
[class] => setup
[type] => ->
[args] => Array
(
)

)

)

[2006-08-04 10:18 UTC] kaiser at unisolution dot de

Some more information:

The Problem here seems to be that SQL Server returns a "Changed database context to 'xxx'." Error after each query. This isn't really an error just an information, but both Pear:DB & Pear:MDB2 seem to threat it like an error. Because of this an Error is reported after each query, but there was no error, the query worked correctly ...

Anyone got a solution for this Problem?

[2006-08-10 13:08 UTC] kaiser at unisolution dot de

I found out this is a bug in PHP 4.3.10, not a bug in MDB2. It`s fixed since PHP 4.3.11.