FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16314&edit=1

ID: 16314
Updated by: cweiske@php.net
Reported By: jan at horde dot org
Summary: Turning empty columns incorrectly to NULL
Status: Open
Type: Bug
Package: MDB2
Package Version: 2.5.0b2
PHP Version: Irrelevant
Roadmap Versions:
New Comment:

Can you give us some example code? I know that it worked for me 2 weeks
ago.


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

[2009-06-10 18:47:57] yunosh

Description:
------------
In MDB2_Statement_Common::_execute(), empty values are casted to NULL,
even if MDB2_PORTABILITY_EMPTY_TO_NULL is not set.

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

Search Discussions

  • Jan at Jun 16, 2009 at 2:52 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=16314&edit=1

    ID: 16314
    Updated by: jan@horde.org
    Reported By: jan at horde dot org
    Summary: Turning empty columns incorrectly to NULL
    Status: Open
    Type: Bug
    Package: MDB2
    Package Version: 2.5.0b2
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    CREATE TABLE `test` (
    `id` varchar(255) NOT NULL,
    PRIMARY KEY (`id`)
    )

    require_once 'MDB2.php';
    $db = MDB2::factory('mysql://horde:pass@localhost/horde');
    $db->setOption('field_case', CASE_LOWER);
    $db->setOption('portability', MDB2_PORTABILITY_FIX_CASE |
    MDB2_PORTABILITY_ERRORS | MDB2_PORTABILITY_FIX_ASSOC_FIELD_NAMES);
    $stmt = $db->prepare('INSERT INTO test (id) VALUES (?)', null,
    MDB2_PREPARE_MANIP);
    var_dump($stmt->execute(array('')));


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

    [2009-06-16 13:22:08] cweiske

    Can you give us some example code? I know that it worked for me 2 weeks
    ago.

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

    [2009-06-10 18:47:57] yunosh

    Description:
    ------------
    In MDB2_Statement_Common::_execute(), empty values are casted to NULL,
    even if MDB2_PORTABILITY_EMPTY_TO_NULL is not set.

    ------------------------------------------------------------------------
  • L Alberton at Jun 20, 2009 at 4:35 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=16314&edit=1

    ID: 16314
    Updated by: l.alberton@quipo.it
    Reported By: jan at horde dot org
    Summary: Turning empty columns incorrectly to NULL
    -Status: Open
    +Status: Feedback
    Type: Bug
    Package: MDB2
    Package Version: 2.5.0b2
    PHP Version: Irrelevant
    -Assigned To:
    +Assigned To: quipo
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Feedback
    -Assigned To:
    +Assigned To: quipo
    I tried your example, an empty string is inserted. Can you double-check
    the example above?
    If you still experience the issue, please provide some info about your
    setup.


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

    [2009-06-16 16:50:47] yunosh

    CREATE TABLE `test` (
    `id` varchar(255) NOT NULL,
    PRIMARY KEY (`id`)
    )

    require_once 'MDB2.php';
    $db = MDB2::factory('mysql://horde:pass@localhost/horde');
    $db->setOption('field_case', CASE_LOWER);
    $db->setOption('portability', MDB2_PORTABILITY_FIX_CASE |
    MDB2_PORTABILITY_ERRORS | MDB2_PORTABILITY_FIX_ASSOC_FIELD_NAMES);
    $stmt = $db->prepare('INSERT INTO test (id) VALUES (?)', null,
    MDB2_PREPARE_MANIP);
    var_dump($stmt->execute(array('')));

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

    [2009-06-16 13:22:08] cweiske

    Can you give us some example code? I know that it worked for me 2 weeks
    ago.

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

    [2009-06-10 18:47:57] yunosh

    Description:
    ------------
    In MDB2_Statement_Common::_execute(), empty values are casted to NULL,
    even if MDB2_PORTABILITY_EMPTY_TO_NULL is not set.

    ------------------------------------------------------------------------
  • Jan at Jun 20, 2009 at 5:01 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=16314&edit=1

    ID: 16314
    Updated by: jan@horde.org
    Reported By: jan at horde dot org
    Summary: Turning empty columns incorrectly to NULL
    Status: Feedback
    Type: Bug
    Package: MDB2
    Package Version: 2.5.0b2
    PHP Version: Irrelevant
    Assigned To: quipo
    Roadmap Versions:
    New Comment:

    I can reproduce this on two different servers with different MDB2
    versions, different MySQL versions, different distributions:

    openSUSE 11.0
    MySQL 5.0.51a
    MDB2 2.5.0b2 beta
    MDB2_Driver_mysql 1.5.0b1 beta

    Ubuntu 9.04
    MySQL 5.0.75
    MDB2 2.4.1 stable
    MDB2_Driver_mysql 1.4.1 stable


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

    [2009-06-20 18:33:43] quipo

    -Status: Open
    +Status: Feedback
    -Assigned To:
    +Assigned To: quipo
    I tried your example, an empty string is inserted. Can you double-check
    the example above?
    If you still experience the issue, please provide some info about your
    setup.

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

    [2009-06-16 16:50:47] yunosh

    CREATE TABLE `test` (
    `id` varchar(255) NOT NULL,
    PRIMARY KEY (`id`)
    )

    require_once 'MDB2.php';
    $db = MDB2::factory('mysql://horde:pass@localhost/horde');
    $db->setOption('field_case', CASE_LOWER);
    $db->setOption('portability', MDB2_PORTABILITY_FIX_CASE |
    MDB2_PORTABILITY_ERRORS | MDB2_PORTABILITY_FIX_ASSOC_FIELD_NAMES);
    $stmt = $db->prepare('INSERT INTO test (id) VALUES (?)', null,
    MDB2_PREPARE_MANIP);
    var_dump($stmt->execute(array('')));

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

    [2009-06-16 13:22:08] cweiske

    Can you give us some example code? I know that it worked for me 2 weeks
    ago.

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

    [2009-06-10 18:47:57] yunosh

    Description:
    ------------
    In MDB2_Statement_Common::_execute(), empty values are casted to NULL,
    even if MDB2_PORTABILITY_EMPTY_TO_NULL is not set.

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJun 16, '09 at 11:23a
activeJun 20, '09 at 5:01p
posts4
users3
websitepear.php.net

3 users in discussion

Jan: 2 posts Cweiske: 1 post L Alberton: 1 post

People

Translate

site design / logo © 2022 Grokbase