mirror of
https://github.com/dg/dibi.git
synced 2025-09-08 21:30:46 +02:00
SqlsrvDriver::applyLimit(): fixed limit and offset behaviour for odbc 11+
SqlsrvReflector: changed constrains metadata loading from INFORMATION_SCHEMA to sys schema to get complete list of all constraints, not PK only
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @dataProvider ../databases.ini !=odbc
|
||||
* @dataProvider ../databases.ini !=odbc, !=sqlsrv
|
||||
*/
|
||||
|
||||
use Tester\Assert;
|
||||
@@ -13,9 +13,9 @@ $conn->loadFile(__DIR__ . "/data/$config[system].sql");
|
||||
|
||||
$info = $conn->query('
|
||||
SELECT products.product_id, orders.order_id, customers.name, products.product_id + 1 AS [xXx]
|
||||
FROM products
|
||||
INNER JOIN orders USING (product_id)
|
||||
INNER JOIN customers USING (customer_id)
|
||||
FROM ([products]
|
||||
INNER JOIN [orders] ON [products.product_id] = [orders.product_id])
|
||||
INNER JOIN [customers] ON [orders.customer_id] = [customers.customer_id]
|
||||
')->getInfo();
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ Assert::same(
|
||||
);
|
||||
|
||||
|
||||
if ($config['driver'] !== 'sqlite3' && $config['driver'] !== 'pdo') {
|
||||
if (!in_array($config['driver'], ['sqlite3', 'pdo', 'sqlsrv'])) {
|
||||
Assert::same(
|
||||
['products.product_id', 'orders.order_id', 'customers.name', 'xXx'],
|
||||
$info->getColumnNames(TRUE)
|
||||
@@ -36,18 +36,18 @@ if ($config['driver'] !== 'sqlite3' && $config['driver'] !== 'pdo') {
|
||||
$columns = $info->getColumns();
|
||||
|
||||
Assert::same('product_id', $columns[0]->getName());
|
||||
if ($config['driver'] !== 'sqlite3' && $config['driver'] !== 'pdo') {
|
||||
if (!in_array($config['driver'], ['sqlite3', 'pdo', 'sqlsrv'])) {
|
||||
Assert::same('products', $columns[0]->getTableName());
|
||||
}
|
||||
Assert::null($columns[0]->getVendorInfo('xxx'));
|
||||
if ($config['system'] !== 'sqlite') {
|
||||
if (!in_array($config['system'], ['sqlite', 'sqlsrv'])) {
|
||||
Assert::same('i', $columns[0]->getType());
|
||||
}
|
||||
Assert::null($columns[0]->isNullable());
|
||||
|
||||
Assert::same('xXx', $columns[3]->getName());
|
||||
Assert::null($columns[3]->getTableName());
|
||||
if ($config['system'] !== 'sqlite') {
|
||||
if (!in_array($config['system'], ['sqlite', 'sqlsrv'])) {
|
||||
Assert::same('i', $columns[0]->getType());
|
||||
}
|
||||
Assert::null($columns[3]->isNullable());
|
||||
|
Reference in New Issue
Block a user