mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 21:58:10 +02:00
DibiResultInfo: fixed case insensitivity
This commit is contained in:
@@ -390,7 +390,7 @@ class DibiResultInfo extends DibiObject
|
|||||||
$this->columns = array();
|
$this->columns = array();
|
||||||
$reflector = $this->driver instanceof IDibiReflector ? $this->driver : NULL;
|
$reflector = $this->driver instanceof IDibiReflector ? $this->driver : NULL;
|
||||||
foreach ($this->driver->getResultColumns() as $info) {
|
foreach ($this->driver->getResultColumns() as $info) {
|
||||||
$this->columns[] = $this->names[$info['name']] = new DibiColumnInfo($reflector, $info);
|
$this->columns[] = $this->names[strtolower($info['name'])] = new DibiColumnInfo($reflector, $info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,7 @@ $conn = new DibiConnection($config);
|
|||||||
$conn->loadFile(__DIR__ . "/data/$config[system].sql");
|
$conn->loadFile(__DIR__ . "/data/$config[system].sql");
|
||||||
|
|
||||||
$info = $conn->query('
|
$info = $conn->query('
|
||||||
SELECT products.product_id, orders.order_id, customers.name, products.product_id + 1 AS xxx
|
SELECT products.product_id, orders.order_id, customers.name, products.product_id + 1 AS [xXx]
|
||||||
FROM products
|
FROM products
|
||||||
INNER JOIN orders USING (product_id)
|
INNER JOIN orders USING (product_id)
|
||||||
INNER JOIN customers USING (customer_id)
|
INNER JOIN customers USING (customer_id)
|
||||||
@@ -24,14 +24,14 @@ $info = $conn->query('
|
|||||||
|
|
||||||
|
|
||||||
Assert::same(
|
Assert::same(
|
||||||
array('product_id', 'order_id', 'name', 'xxx'),
|
array('product_id', 'order_id', 'name', 'xXx'),
|
||||||
$info->getColumnNames()
|
$info->getColumnNames()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
if ($config['driver'] !== 'sqlite3' && $config['driver'] !== 'pdo') {
|
if ($config['driver'] !== 'sqlite3' && $config['driver'] !== 'pdo') {
|
||||||
Assert::same(
|
Assert::same(
|
||||||
array('products.product_id', 'orders.order_id', 'customers.name', 'xxx'),
|
array('products.product_id', 'orders.order_id', 'customers.name', 'xXx'),
|
||||||
$info->getColumnNames(TRUE)
|
$info->getColumnNames(TRUE)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -49,9 +49,12 @@ if ($config['system'] !== 'sqlite') {
|
|||||||
}
|
}
|
||||||
Assert::null($columns[0]->nullable);
|
Assert::null($columns[0]->nullable);
|
||||||
|
|
||||||
Assert::same('xxx', $columns[3]->name);
|
Assert::same('xXx', $columns[3]->name);
|
||||||
Assert::null($columns[3]->tableName);
|
Assert::null($columns[3]->tableName);
|
||||||
if ($config['system'] !== 'sqlite') {
|
if ($config['system'] !== 'sqlite') {
|
||||||
Assert::same('i', $columns[0]->type);
|
Assert::same('i', $columns[0]->type);
|
||||||
}
|
}
|
||||||
Assert::null($columns[3]->nullable);
|
Assert::null($columns[3]->nullable);
|
||||||
|
|
||||||
|
Assert::same('xXx', $info->getColumn('xxx')->getName());
|
||||||
|
Assert::same('xXx', $info->getColumn('xXx')->getName());
|
||||||
|
Reference in New Issue
Block a user