Bug #15213 [Opn]: Error when restoring database (OCI8)
| From: | ifeghali@php.net | Date: | Sun, 22 Feb 2009 14:57:42 +0000 |
| Subject: | Bug #15213 [Opn]: Error when restoring database (OCI8) | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-60@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=15213&edit=1
ID: 15213
Updated by: ifeghali@php.net
Reported By: ionut dot aivanesei at gmail dot com
Summary: Error when restoring database (OCI8)
Status: Open
Type: Bug
Package: MDB2_Schema
Operating System: Irrelevant
Package Version: 0.8.4
PHP Version: Irrelevant
Roadmap Versions:
New Comment:
on your test XML set
<create>true</create>
try again and tell me if that fixes for you. I couldn't reproduce this
problem with MySQL so its probably something with OCI driver or a
previous definition of that databases that is not being overwritten.
Previous Comments:
------------------------------------------------------------------------
[2008-12-08 13:36:56] galiganu
TEST SCRIPT:
<?php
require_once 'MDB2/Schema.php';
$options = array(
'use_transactions' => false,
'fail_on_invalid_names' => true,
'quote_identifier' => false,
'force_defaults' => false,
'portability' => true,
'debug' => true
);
$dsn = 'oci8://sa:sa@localhost:1521/?service=test';
$schema =& MDB2_Schema::factory($dsn, $options);
if (PEAR::isError($schema))
{
echo 'schema error: ' . print_r($schema, true);
}
else
{
$disable_query = true;
$definition =
$schema->parseDatabaseDefinitionFile('test.xml');
if (PEAR::isError($definition))
{
echo 'definition error: ' . print_r($definition, true);
}
else
{
$op = $schema->createDatabase($definition, array(),
$disable_query);
if (PEAR::isError($op))
{
echo 'op error: ' . print_r($op, true);
}
}
}
$schema->disconnect();
exit();
?>
TEST XML:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<database>
<name>test</name>
<create>false</create>
<overwrite>true</overwrite>
<charset>latin1</charset>
<table>
<name>deliveries</name>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<length>4</length>
</field>
<field>
<name>delivery_date</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>10</length>
</field>
<field>
<name>delivery_name</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>40</length>
</field>
</declaration>
<initialization>
<insert>
<field>
<name>id</name>
<value>1</value>
</field>
<field>
<name>delivery_date</name>
<value>2008-10-01</value>
</field>
<field>
<name>delivery_name</name>
<value>INITIAL</value>
</field>
</insert>
</initialization>
</table>
</database>
------------------------------------------------------------------------
[2008-12-08 04:10:32] doconnor
Executable test steps would be really handy!
------------------------------------------------------------------------
[2008-12-06 20:12:59] galiganu
I have a table declaration (the one above) with one insert. When i try
to use MDB2_Schema to import that xml into an oracle database i get the
error shown above.
If you need any othewr information please let me know. I will provide
it.
Thanks
------------------------------------------------------------------------
[2008-12-06 08:06:05] doconnor
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PEAR.
Without reproduce code this one is a bit tricky. Can you add some?
It could very well be the MDB2 oracle driver, rather than MDB_Schema.
------------------------------------------------------------------------
[2008-12-02 12:45:38] galiganu
Description:
------------
Hi
I have an error when importing one table into the database.
Table definition and data:
-------------------------
<table>
<name>deliveries</name>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<length>4</length>
</field>
<field>
<name>delivery_date</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>10</length>
</field>
<field>
<name>delivery_name</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>40</length>
</field>
</declaration>
<initialization>
<insert>
<field>
<name>id</name>
<value>1</value>
</field>
<field>
<name>delivery_date</name>
<value>2008-10-01</value>
</field>
<field>
<name>delivery_name</name>
<value>INITIAL</value>
</field>
</insert>
</initialization>
</table>
Error is:
--------
MDB2 Error: unknown error
code :-1
info :_doQuery: [Error message: Could not execute statement]
[Last executed query: INSERT INTO deliveries (id, delivery_date,
delivery_name) VALUES ('1', '2008-10-01 00:00:00', 'INITIAL')]
[Native code: 12899]
[Native message: ORA-12899: value too large for column
"DB"."TABLE"."DELIVERY_DATE" (actual: 19, maximum: 10)]
I dont know why the ' 00:00:00' was added for that field.
Thanks
gali
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=15213&edit=1