Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql & Mysqli drivers: bug in detection unsigned columns #16

Closed
PetrP opened this issue Jun 30, 2010 · 0 comments
Closed

Mysql & Mysqli drivers: bug in detection unsigned columns #16

PetrP opened this issue Jun 30, 2010 · 0 comments

Comments

@PetrP
Copy link
Contributor

PetrP commented Jun 30, 2010

unsigned se špatně detekuje. Blbé pořadí parametrů ve funkci strstr viz
forum

Oprava zde: PetrP/dibi@9df5ec9

Zde je test:

/*
CREATE TABLE `test4` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `int` int(10) unsigned NOT NULL,
    `int2` int(10) unsigned zerofill NOT NULL,
    `int3` int(10) NOT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB;
*/

$connetion = new DibiConnection(array(
    'driver' => 'mysql',
    'username' => 'root',
    'database' => 'test',
));

T::note(get_class($connetion->getDriver()));
foreach ($connetion->getDriver()->getColumns('test4') as $column)
{
    T::dump($column['unsigned'], $column['name']);
}

$connetion = new DibiConnection(array(
    'driver' => 'mysqli',
    'username' => 'root',
    'database' => 'test',
));

T::note(get_class($connetion->getDriver()));
foreach ($connetion->getDriver()->getColumns('test4') as $column)
{
    T::dump($column['unsigned'], $column['name']);
}


__halt_compiler() ?>
------EXPECT------
DibiMySqlDriver

id: bool(TRUE)

int: bool(TRUE)

int2: bool(TRUE)

int3: bool(FALSE)

DibiMySqliDriver

id: bool(TRUE)

int: bool(TRUE)

int2: bool(TRUE)

int3: bool(FALSE)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant