Source of file Driver.php

Size: 8,786 Bytes - Last Modified: 2015-11-10T09:58:30-05:00

../src/Query/Drivers/Firebird/Driver.php

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
Covered by 1 test(s):
  • FirebirdQBTest::testGetNamedConnection
83
Covered by 1 test(s):
  • FirebirdQBTest::testGetNamedConnection
84
Covered by 1 test(s):
  • FirebirdQBTest::testGetNamedConnection
8586
Covered by 1 test(s):
  • FirebirdQBTest::testGetNamedConnection
87
Covered by 1 test(s):
  • FirebirdQBTest::testGetNamedConnection
888990
Covered by 1 test(s):
  • FirebirdQBTest::testGetNamedConnection
919293949596
Covered by 1 test(s):
  • FirebirdQBTest::testGetNamedConnection
97
Covered by 1 test(s):
  • FirebirdQBTest::testGetNamedConnection
9899100101102103104105106107108109110111112113114115116117118119
Covered by 1 test(s):
  • FirebirdQBTest::testBackupStructure
120121122123124125126127128129130131132133
Covered by 1 test(s):
  • FirebirdTest::testExec
134135136137138139140141142143144145146
Covered by 1 test(s):
  • FirebirdTest::testGetAttribute
147148149150151152153154155156157158
Covered by 1 test(s):
  • FirebirdTest::testInTransaction
159160161162163164165166167168169170171
Covered by 1 test(s):
  • FirebirdTest::testLastInsertId
172173174175176177178179180181182183184185186
Covered by 55 test(s):
  • FirebirdTest::testNullResultMethods
  • FirebirdTest::testExists
  • FirebirdTest::testConnection
  • FirebirdTest::testGetSystemTables
  • FirebirdTest::testCreateTable
  • FirebirdTest::testDeleteTable
  • FirebirdTest::testTruncate
  • FirebirdTest::testCommitTransaction
  • FirebirdTest::testRollbackTransaction
  • FirebirdTest::testPreparedStatements
  • FirebirdTest::testPrepareExecute
  • FirebirdTest::testFetch
  • FirebirdTest::testPrepareQuery
  • FirebirdTest::testErrorInfo
  • FirebirdTest::testErrorCode
  • FirebirdTest::testDBList
  • FirebirdTest::testExec
  • FirebirdTest::testInTransaction
  • FirebirdTest::testGetAttribute
  • FirebirdTest::testSetAttribute
  • FirebirdTest::testLastInsertId
  • FirebirdTest::testGetTables
  • FirebirdTest::testBackupData
  • FirebirdTest::testGetColumns
  • FirebirdTest::testGetTypes
  • FirebirdTest::testGetFKs
  • FirebirdTest::testGetIndexes
  • FirebirdTest::testGetViews
  • FirebirdTest::testGetTriggers
  • FirebirdTest::testGetSequences
  • FirebirdTest::testGetProcedures
  • FirebirdTest::testGetFunctions
  • FirebirdQBTest::testTypeList
  • FirebirdQBTest::testResultErrors
  • FirebirdQBTest::testFunctionGet
  • FirebirdQBTest::testGet
  • FirebirdQBTest::testPrefixGet
  • FirebirdQBTest::testGetWNumRows
  • FirebirdQBTest::testGetLimit
  • FirebirdQBTest::testGetLimitSkip
  • FirebirdQBTest::testSelectAvg
  • FirebirdQBTest::testSelectSum
  • FirebirdQBTest::testSelectDistinct
  • FirebirdQBTest::testSelectGet
  • FirebirdQBTest::testSelectMax
  • FirebirdQBTest::testSelectMin
  • FirebirdQBTest::testMultiOrderBy
  • FirebirdQBTest::testJoin
  • FirebirdQBTest::testLeftJoin
  • FirebirdQBTest::testInnerJoin
  • FirebirdQBTest::testInsertBatch
  • FirebirdQBTest::testCountAll
  • FirebirdQBTest::testCountAllResults
  • FirebirdQBTest::testNumRows
  • FirebirdQBTest::testGetCompiledSelect
187188
Covered by 55 test(s):
  • FirebirdTest::testNullResultMethods
  • FirebirdTest::testExists
  • FirebirdTest::testConnection
  • FirebirdTest::testGetSystemTables
  • FirebirdTest::testCreateTable
  • FirebirdTest::testDeleteTable
  • FirebirdTest::testTruncate
  • FirebirdTest::testCommitTransaction
  • FirebirdTest::testRollbackTransaction
  • FirebirdTest::testPreparedStatements
  • FirebirdTest::testPrepareExecute
  • FirebirdTest::testFetch
  • FirebirdTest::testPrepareQuery
  • FirebirdTest::testErrorInfo
  • FirebirdTest::testErrorCode
  • FirebirdTest::testDBList
  • FirebirdTest::testExec
  • FirebirdTest::testInTransaction
  • FirebirdTest::testGetAttribute
  • FirebirdTest::testSetAttribute
  • FirebirdTest::testLastInsertId
  • FirebirdTest::testGetTables
  • FirebirdTest::testBackupData
  • FirebirdTest::testGetColumns
  • FirebirdTest::testGetTypes
  • FirebirdTest::testGetFKs
  • FirebirdTest::testGetIndexes
  • FirebirdTest::testGetViews
  • FirebirdTest::testGetTriggers
  • FirebirdTest::testGetSequences
  • FirebirdTest::testGetProcedures
  • FirebirdTest::testGetFunctions
  • FirebirdQBTest::testTypeList
  • FirebirdQBTest::testResultErrors
  • FirebirdQBTest::testFunctionGet
  • FirebirdQBTest::testGet
  • FirebirdQBTest::testPrefixGet
  • FirebirdQBTest::testGetWNumRows
  • FirebirdQBTest::testGetLimit
  • FirebirdQBTest::testGetLimitSkip
  • FirebirdQBTest::testSelectAvg
  • FirebirdQBTest::testSelectSum
  • FirebirdQBTest::testSelectDistinct
  • FirebirdQBTest::testSelectGet
  • FirebirdQBTest::testSelectMax
  • FirebirdQBTest::testSelectMin
  • FirebirdQBTest::testMultiOrderBy
  • FirebirdQBTest::testJoin
  • FirebirdQBTest::testLeftJoin
  • FirebirdQBTest::testInnerJoin
  • FirebirdQBTest::testInsertBatch
  • FirebirdQBTest::testCountAll
  • FirebirdQBTest::testCountAllResults
  • FirebirdQBTest::testNumRows
  • FirebirdQBTest::testGetCompiledSelect
189
Covered by 55 test(s):
  • FirebirdTest::testNullResultMethods
  • FirebirdTest::testExists
  • FirebirdTest::testConnection
  • FirebirdTest::testGetSystemTables
  • FirebirdTest::testCreateTable
  • FirebirdTest::testDeleteTable
  • FirebirdTest::testTruncate
  • FirebirdTest::testCommitTransaction
  • FirebirdTest::testRollbackTransaction
  • FirebirdTest::testPreparedStatements
  • FirebirdTest::testPrepareExecute
  • FirebirdTest::testFetch
  • FirebirdTest::testPrepareQuery
  • FirebirdTest::testErrorInfo
  • FirebirdTest::testErrorCode
  • FirebirdTest::testDBList
  • FirebirdTest::testExec
  • FirebirdTest::testInTransaction
  • FirebirdTest::testGetAttribute
  • FirebirdTest::testSetAttribute
  • FirebirdTest::testLastInsertId
  • FirebirdTest::testGetTables
  • FirebirdTest::testBackupData
  • FirebirdTest::testGetColumns
  • FirebirdTest::testGetTypes
  • FirebirdTest::testGetFKs
  • FirebirdTest::testGetIndexes
  • FirebirdTest::testGetViews
  • FirebirdTest::testGetTriggers
  • FirebirdTest::testGetSequences
  • FirebirdTest::testGetProcedures
  • FirebirdTest::testGetFunctions
  • FirebirdQBTest::testTypeList
  • FirebirdQBTest::testResultErrors
  • FirebirdQBTest::testFunctionGet
  • FirebirdQBTest::testGet
  • FirebirdQBTest::testPrefixGet
  • FirebirdQBTest::testGetWNumRows
  • FirebirdQBTest::testGetLimit
  • FirebirdQBTest::testGetLimitSkip
  • FirebirdQBTest::testSelectAvg
  • FirebirdQBTest::testSelectSum
  • FirebirdQBTest::testSelectDistinct
  • FirebirdQBTest::testSelectGet
  • FirebirdQBTest::testSelectMax
  • FirebirdQBTest::testSelectMin
  • FirebirdQBTest::testMultiOrderBy
  • FirebirdQBTest::testJoin
  • FirebirdQBTest::testLeftJoin
  • FirebirdQBTest::testInnerJoin
  • FirebirdQBTest::testInsertBatch
  • FirebirdQBTest::testCountAll
  • FirebirdQBTest::testCountAllResults
  • FirebirdQBTest::testNumRows
  • FirebirdQBTest::testGetCompiledSelect
190
Covered by 55 test(s):
  • FirebirdTest::testNullResultMethods
  • FirebirdTest::testExists
  • FirebirdTest::testConnection
  • FirebirdTest::testGetSystemTables
  • FirebirdTest::testCreateTable
  • FirebirdTest::testDeleteTable
  • FirebirdTest::testTruncate
  • FirebirdTest::testCommitTransaction
  • FirebirdTest::testRollbackTransaction
  • FirebirdTest::testPreparedStatements
  • FirebirdTest::testPrepareExecute
  • FirebirdTest::testFetch
  • FirebirdTest::testPrepareQuery
  • FirebirdTest::testErrorInfo
  • FirebirdTest::testErrorCode
  • FirebirdTest::testDBList
  • FirebirdTest::testExec
  • FirebirdTest::testInTransaction
  • FirebirdTest::testGetAttribute
  • FirebirdTest::testSetAttribute
  • FirebirdTest::testLastInsertId
  • FirebirdTest::testGetTables
  • FirebirdTest::testBackupData
  • FirebirdTest::testGetColumns
  • FirebirdTest::testGetTypes
  • FirebirdTest::testGetFKs
  • FirebirdTest::testGetIndexes
  • FirebirdTest::testGetViews
  • FirebirdTest::testGetTriggers
  • FirebirdTest::testGetSequences
  • FirebirdTest::testGetProcedures
  • FirebirdTest::testGetFunctions
  • FirebirdQBTest::testTypeList
  • FirebirdQBTest::testResultErrors
  • FirebirdQBTest::testFunctionGet
  • FirebirdQBTest::testGet
  • FirebirdQBTest::testPrefixGet
  • FirebirdQBTest::testGetWNumRows
  • FirebirdQBTest::testGetLimit
  • FirebirdQBTest::testGetLimitSkip
  • FirebirdQBTest::testSelectAvg
  • FirebirdQBTest::testSelectSum
  • FirebirdQBTest::testSelectDistinct
  • FirebirdQBTest::testSelectGet
  • FirebirdQBTest::testSelectMax
  • FirebirdQBTest::testSelectMin
  • FirebirdQBTest::testMultiOrderBy
  • FirebirdQBTest::testJoin
  • FirebirdQBTest::testLeftJoin
  • FirebirdQBTest::testInnerJoin
  • FirebirdQBTest::testInsertBatch
  • FirebirdQBTest::testCountAll
  • FirebirdQBTest::testCountAllResults
  • FirebirdQBTest::testNumRows
  • FirebirdQBTest::testGetCompiledSelect
191192193
Covered by 55 test(s):
  • FirebirdTest::testNullResultMethods
  • FirebirdTest::testExists
  • FirebirdTest::testConnection
  • FirebirdTest::testGetSystemTables
  • FirebirdTest::testCreateTable
  • FirebirdTest::testDeleteTable
  • FirebirdTest::testTruncate
  • FirebirdTest::testCommitTransaction
  • FirebirdTest::testRollbackTransaction
  • FirebirdTest::testPreparedStatements
  • FirebirdTest::testPrepareExecute
  • FirebirdTest::testFetch
  • FirebirdTest::testPrepareQuery
  • FirebirdTest::testErrorInfo
  • FirebirdTest::testErrorCode
  • FirebirdTest::testDBList
  • FirebirdTest::testExec
  • FirebirdTest::testInTransaction
  • FirebirdTest::testGetAttribute
  • FirebirdTest::testSetAttribute
  • FirebirdTest::testLastInsertId
  • FirebirdTest::testGetTables
  • FirebirdTest::testBackupData
  • FirebirdTest::testGetColumns
  • FirebirdTest::testGetTypes
  • FirebirdTest::testGetFKs
  • FirebirdTest::testGetIndexes
  • FirebirdTest::testGetViews
  • FirebirdTest::testGetTriggers
  • FirebirdTest::testGetSequences
  • FirebirdTest::testGetProcedures
  • FirebirdTest::testGetFunctions
  • FirebirdQBTest::testTypeList
  • FirebirdQBTest::testResultErrors
  • FirebirdQBTest::testFunctionGet
  • FirebirdQBTest::testGet
  • FirebirdQBTest::testPrefixGet
  • FirebirdQBTest::testGetWNumRows
  • FirebirdQBTest::testGetLimit
  • FirebirdQBTest::testGetLimitSkip
  • FirebirdQBTest::testSelectAvg
  • FirebirdQBTest::testSelectSum
  • FirebirdQBTest::testSelectDistinct
  • FirebirdQBTest::testSelectGet
  • FirebirdQBTest::testSelectMax
  • FirebirdQBTest::testSelectMin
  • FirebirdQBTest::testMultiOrderBy
  • FirebirdQBTest::testJoin
  • FirebirdQBTest::testLeftJoin
  • FirebirdQBTest::testInnerJoin
  • FirebirdQBTest::testInsertBatch
  • FirebirdQBTest::testCountAll
  • FirebirdQBTest::testCountAllResults
  • FirebirdQBTest::testNumRows
  • FirebirdQBTest::testGetCompiledSelect
194
Covered by 55 test(s):
  • FirebirdTest::testNullResultMethods
  • FirebirdTest::testExists
  • FirebirdTest::testConnection
  • FirebirdTest::testGetSystemTables
  • FirebirdTest::testCreateTable
  • FirebirdTest::testDeleteTable
  • FirebirdTest::testTruncate
  • FirebirdTest::testCommitTransaction
  • FirebirdTest::testRollbackTransaction
  • FirebirdTest::testPreparedStatements
  • FirebirdTest::testPrepareExecute
  • FirebirdTest::testFetch
  • FirebirdTest::testPrepareQuery
  • FirebirdTest::testErrorInfo
  • FirebirdTest::testErrorCode
  • FirebirdTest::testDBList
  • FirebirdTest::testExec
  • FirebirdTest::testInTransaction
  • FirebirdTest::testGetAttribute
  • FirebirdTest::testSetAttribute
  • FirebirdTest::testLastInsertId
  • FirebirdTest::testGetTables
  • FirebirdTest::testBackupData
  • FirebirdTest::testGetColumns
  • FirebirdTest::testGetTypes
  • FirebirdTest::testGetFKs
  • FirebirdTest::testGetIndexes
  • FirebirdTest::testGetViews
  • FirebirdTest::testGetTriggers
  • FirebirdTest::testGetSequences
  • FirebirdTest::testGetProcedures
  • FirebirdTest::testGetFunctions
  • FirebirdQBTest::testTypeList
  • FirebirdQBTest::testResultErrors
  • FirebirdQBTest::testFunctionGet
  • FirebirdQBTest::testGet
  • FirebirdQBTest::testPrefixGet
  • FirebirdQBTest::testGetWNumRows
  • FirebirdQBTest::testGetLimit
  • FirebirdQBTest::testGetLimitSkip
  • FirebirdQBTest::testSelectAvg
  • FirebirdQBTest::testSelectSum
  • FirebirdQBTest::testSelectDistinct
  • FirebirdQBTest::testSelectGet
  • FirebirdQBTest::testSelectMax
  • FirebirdQBTest::testSelectMin
  • FirebirdQBTest::testMultiOrderBy
  • FirebirdQBTest::testJoin
  • FirebirdQBTest::testLeftJoin
  • FirebirdQBTest::testInnerJoin
  • FirebirdQBTest::testInsertBatch
  • FirebirdQBTest::testCountAll
  • FirebirdQBTest::testCountAllResults
  • FirebirdQBTest::testNumRows
  • FirebirdQBTest::testGetCompiledSelect
195196
Covered by 55 test(s):
  • FirebirdTest::testNullResultMethods
  • FirebirdTest::testExists
  • FirebirdTest::testConnection
  • FirebirdTest::testGetSystemTables
  • FirebirdTest::testCreateTable
  • FirebirdTest::testDeleteTable
  • FirebirdTest::testTruncate
  • FirebirdTest::testCommitTransaction
  • FirebirdTest::testRollbackTransaction
  • FirebirdTest::testPreparedStatements
  • FirebirdTest::testPrepareExecute
  • FirebirdTest::testFetch
  • FirebirdTest::testPrepareQuery
  • FirebirdTest::testErrorInfo
  • FirebirdTest::testErrorCode
  • FirebirdTest::testDBList
  • FirebirdTest::testExec
  • FirebirdTest::testInTransaction
  • FirebirdTest::testGetAttribute
  • FirebirdTest::testSetAttribute
  • FirebirdTest::testLastInsertId
  • FirebirdTest::testGetTables
  • FirebirdTest::testBackupData
  • FirebirdTest::testGetColumns
  • FirebirdTest::testGetTypes
  • FirebirdTest::testGetFKs
  • FirebirdTest::testGetIndexes
  • FirebirdTest::testGetViews
  • FirebirdTest::testGetTriggers
  • FirebirdTest::testGetSequences
  • FirebirdTest::testGetProcedures
  • FirebirdTest::testGetFunctions
  • FirebirdQBTest::testTypeList
  • FirebirdQBTest::testResultErrors
  • FirebirdQBTest::testFunctionGet
  • FirebirdQBTest::testGet
  • FirebirdQBTest::testPrefixGet
  • FirebirdQBTest::testGetWNumRows
  • FirebirdQBTest::testGetLimit
  • FirebirdQBTest::testGetLimitSkip
  • FirebirdQBTest::testSelectAvg
  • FirebirdQBTest::testSelectSum
  • FirebirdQBTest::testSelectDistinct
  • FirebirdQBTest::testSelectGet
  • FirebirdQBTest::testSelectMax
  • FirebirdQBTest::testSelectMin
  • FirebirdQBTest::testMultiOrderBy
  • FirebirdQBTest::testJoin
  • FirebirdQBTest::testLeftJoin
  • FirebirdQBTest::testInnerJoin
  • FirebirdQBTest::testInsertBatch
  • FirebirdQBTest::testCountAll
  • FirebirdQBTest::testCountAllResults
  • FirebirdQBTest::testNumRows
  • FirebirdQBTest::testGetCompiledSelect
197198
Covered by 55 test(s):
  • FirebirdTest::testNullResultMethods
  • FirebirdTest::testExists
  • FirebirdTest::testConnection
  • FirebirdTest::testGetSystemTables
  • FirebirdTest::testCreateTable
  • FirebirdTest::testDeleteTable
  • FirebirdTest::testTruncate
  • FirebirdTest::testCommitTransaction
  • FirebirdTest::testRollbackTransaction
  • FirebirdTest::testPreparedStatements
  • FirebirdTest::testPrepareExecute
  • FirebirdTest::testFetch
  • FirebirdTest::testPrepareQuery
  • FirebirdTest::testErrorInfo
  • FirebirdTest::testErrorCode
  • FirebirdTest::testDBList
  • FirebirdTest::testExec
  • FirebirdTest::testInTransaction
  • FirebirdTest::testGetAttribute
  • FirebirdTest::testSetAttribute
  • FirebirdTest::testLastInsertId
  • FirebirdTest::testGetTables
  • FirebirdTest::testBackupData
  • FirebirdTest::testGetColumns
  • FirebirdTest::testGetTypes
  • FirebirdTest::testGetFKs
  • FirebirdTest::testGetIndexes
  • FirebirdTest::testGetViews
  • FirebirdTest::testGetTriggers
  • FirebirdTest::testGetSequences
  • FirebirdTest::testGetProcedures
  • FirebirdTest::testGetFunctions
  • FirebirdQBTest::testTypeList
  • FirebirdQBTest::testResultErrors
  • FirebirdQBTest::testFunctionGet
  • FirebirdQBTest::testGet
  • FirebirdQBTest::testPrefixGet
  • FirebirdQBTest::testGetWNumRows
  • FirebirdQBTest::testGetLimit
  • FirebirdQBTest::testGetLimitSkip
  • FirebirdQBTest::testSelectAvg
  • FirebirdQBTest::testSelectSum
  • FirebirdQBTest::testSelectDistinct
  • FirebirdQBTest::testSelectGet
  • FirebirdQBTest::testSelectMax
  • FirebirdQBTest::testSelectMin
  • FirebirdQBTest::testMultiOrderBy
  • FirebirdQBTest::testJoin
  • FirebirdQBTest::testLeftJoin
  • FirebirdQBTest::testInnerJoin
  • FirebirdQBTest::testInsertBatch
  • FirebirdQBTest::testCountAll
  • FirebirdQBTest::testCountAllResults
  • FirebirdQBTest::testNumRows
  • FirebirdQBTest::testGetCompiledSelect
199200201202203204205206207208209210211212213
Covered by 37 test(s):
  • FirebirdTest::testPreparedStatements
  • FirebirdTest::testPrepareExecute
  • FirebirdQBTest::testGetWhere
  • FirebirdQBTest::testHaving
  • FirebirdQBTest::testOrHaving
  • FirebirdQBTest::testSelectWhereGet
  • FirebirdQBTest::testSelectFromGet
  • FirebirdQBTest::testSelectFromLimitGet
  • FirebirdQBTest::testSelectWhereGet2
  • FirebirdQBTest::testGroup
  • FirebirdQBTest::testOrGroup
  • FirebirdQBTest::testOrNotGroup
  • FirebirdQBTest::testGroupCamelCase
  • FirebirdQBTest::testWhereIn
  • FirebirdQBTest::testOrWhereIn
  • FirebirdQBTest::testWhereNotIn
  • FirebirdQBTest::testOrWhereNotIn
  • FirebirdQBTest::testOrderBy
  • FirebirdQBTest::testOrderByRandom
  • FirebirdQBTest::testGroupBy
  • FirebirdQBTest::testOrWhere
  • FirebirdQBTest::testLike
  • FirebirdQBTest::testOrLike
  • FirebirdQBTest::testOrNotLike
  • FirebirdQBTest::testNotLike
  • FirebirdQBTest::testLikeBefore
  • FirebirdQBTest::testLikeAfter
  • FirebirdQBTest::testJoinWithMultipleWhereValues
  • FirebirdQBTest::testInsert
  • FirebirdQBTest::testInsertArray
  • FirebirdQBTest::testUpdate
  • FirebirdQBTest::testSetArrayUpdate
  • FirebirdQBTest::testWhereSetUpdate
  • FirebirdQBTest::testDelete
  • FirebirdQBTest::testDeleteWithMultipleWhereValues
  • FirebirdQBTest::testCountAllResults2
  • FirebirdQBTest::testBadNumRows
214215216
Covered by 37 test(s):
  • FirebirdTest::testPreparedStatements
  • FirebirdTest::testPrepareExecute
  • FirebirdQBTest::testGetWhere
  • FirebirdQBTest::testHaving
  • FirebirdQBTest::testOrHaving
  • FirebirdQBTest::testSelectWhereGet
  • FirebirdQBTest::testSelectFromGet
  • FirebirdQBTest::testSelectFromLimitGet
  • FirebirdQBTest::testSelectWhereGet2
  • FirebirdQBTest::testGroup
  • FirebirdQBTest::testOrGroup
  • FirebirdQBTest::testOrNotGroup
  • FirebirdQBTest::testGroupCamelCase
  • FirebirdQBTest::testWhereIn
  • FirebirdQBTest::testOrWhereIn
  • FirebirdQBTest::testWhereNotIn
  • FirebirdQBTest::testOrWhereNotIn
  • FirebirdQBTest::testOrderBy
  • FirebirdQBTest::testOrderByRandom
  • FirebirdQBTest::testGroupBy
  • FirebirdQBTest::testOrWhere
  • FirebirdQBTest::testLike
  • FirebirdQBTest::testOrLike
  • FirebirdQBTest::testOrNotLike
  • FirebirdQBTest::testNotLike
  • FirebirdQBTest::testLikeBefore
  • FirebirdQBTest::testLikeAfter
  • FirebirdQBTest::testJoinWithMultipleWhereValues
  • FirebirdQBTest::testInsert
  • FirebirdQBTest::testInsertArray
  • FirebirdQBTest::testUpdate
  • FirebirdQBTest::testSetArrayUpdate
  • FirebirdQBTest::testWhereSetUpdate
  • FirebirdQBTest::testDelete
  • FirebirdQBTest::testDeleteWithMultipleWhereValues
  • FirebirdQBTest::testCountAllResults2
  • FirebirdQBTest::testBadNumRows
217218
Covered by 37 test(s):
  • FirebirdTest::testPreparedStatements
  • FirebirdTest::testPrepareExecute
  • FirebirdQBTest::testGetWhere
  • FirebirdQBTest::testHaving
  • FirebirdQBTest::testOrHaving
  • FirebirdQBTest::testSelectWhereGet
  • FirebirdQBTest::testSelectFromGet
  • FirebirdQBTest::testSelectFromLimitGet
  • FirebirdQBTest::testSelectWhereGet2
  • FirebirdQBTest::testGroup
  • FirebirdQBTest::testOrGroup
  • FirebirdQBTest::testOrNotGroup
  • FirebirdQBTest::testGroupCamelCase
  • FirebirdQBTest::testWhereIn
  • FirebirdQBTest::testOrWhereIn
  • FirebirdQBTest::testWhereNotIn
  • FirebirdQBTest::testOrWhereNotIn
  • FirebirdQBTest::testOrderBy
  • FirebirdQBTest::testOrderByRandom
  • FirebirdQBTest::testGroupBy
  • FirebirdQBTest::testOrWhere
  • FirebirdQBTest::testLike
  • FirebirdQBTest::testOrLike
  • FirebirdQBTest::testOrNotLike
  • FirebirdQBTest::testNotLike
  • FirebirdQBTest::testLikeBefore
  • FirebirdQBTest::testLikeAfter
  • FirebirdQBTest::testJoinWithMultipleWhereValues
  • FirebirdQBTest::testInsert
  • FirebirdQBTest::testInsertArray
  • FirebirdQBTest::testUpdate
  • FirebirdQBTest::testSetArrayUpdate
  • FirebirdQBTest::testWhereSetUpdate
  • FirebirdQBTest::testDelete
  • FirebirdQBTest::testDeleteWithMultipleWhereValues
  • FirebirdQBTest::testCountAllResults2
  • FirebirdQBTest::testBadNumRows
219220
Covered by 37 test(s):
  • FirebirdTest::testPreparedStatements
  • FirebirdTest::testPrepareExecute
  • FirebirdQBTest::testGetWhere
  • FirebirdQBTest::testHaving
  • FirebirdQBTest::testOrHaving
  • FirebirdQBTest::testSelectWhereGet
  • FirebirdQBTest::testSelectFromGet
  • FirebirdQBTest::testSelectFromLimitGet
  • FirebirdQBTest::testSelectWhereGet2
  • FirebirdQBTest::testGroup
  • FirebirdQBTest::testOrGroup
  • FirebirdQBTest::testOrNotGroup
  • FirebirdQBTest::testGroupCamelCase
  • FirebirdQBTest::testWhereIn
  • FirebirdQBTest::testOrWhereIn
  • FirebirdQBTest::testWhereNotIn
  • FirebirdQBTest::testOrWhereNotIn
  • FirebirdQBTest::testOrderBy
  • FirebirdQBTest::testOrderByRandom
  • FirebirdQBTest::testGroupBy
  • FirebirdQBTest::testOrWhere
  • FirebirdQBTest::testLike
  • FirebirdQBTest::testOrLike
  • FirebirdQBTest::testOrNotLike
  • FirebirdQBTest::testNotLike
  • FirebirdQBTest::testLikeBefore
  • FirebirdQBTest::testLikeAfter
  • FirebirdQBTest::testJoinWithMultipleWhereValues
  • FirebirdQBTest::testInsert
  • FirebirdQBTest::testInsertArray
  • FirebirdQBTest::testUpdate
  • FirebirdQBTest::testSetArrayUpdate
  • FirebirdQBTest::testWhereSetUpdate
  • FirebirdQBTest::testDelete
  • FirebirdQBTest::testDeleteWithMultipleWhereValues
  • FirebirdQBTest::testCountAllResults2
  • FirebirdQBTest::testBadNumRows
221222223224225226227228229230231232
Covered by 3 test(s):
  • FirebirdTest::testCommitTransaction
  • FirebirdTest::testRollbackTransaction
  • FirebirdTest::testInTransaction
233234235236237238239240241242243244
Covered by 1 test(s):
  • FirebirdTest::testCommitTransaction
245
Covered by 1 test(s):
  • FirebirdTest::testCommitTransaction
246
Covered by 1 test(s):
  • FirebirdTest::testCommitTransaction
247248249250251252253254255256257258
Covered by 2 test(s):
  • FirebirdTest::testRollbackTransaction
  • FirebirdTest::testInTransaction
259
Covered by 2 test(s):
  • FirebirdTest::testRollbackTransaction
  • FirebirdTest::testInTransaction
260
Covered by 2 test(s):
  • FirebirdTest::testRollbackTransaction
  • FirebirdTest::testInTransaction
261262263264265266267268269270271272273
Covered by 1 test(s):
  • FirebirdTest::testSetAttribute
274275276277278279280281282283284285286287
Covered by 36 test(s):
  • FirebirdTest::testPrepareExecute
  • FirebirdQBTest::testGetWhere
  • FirebirdQBTest::testHaving
  • FirebirdQBTest::testOrHaving
  • FirebirdQBTest::testSelectWhereGet
  • FirebirdQBTest::testSelectFromGet
  • FirebirdQBTest::testSelectFromLimitGet
  • FirebirdQBTest::testSelectWhereGet2
  • FirebirdQBTest::testGroup
  • FirebirdQBTest::testOrGroup
  • FirebirdQBTest::testOrNotGroup
  • FirebirdQBTest::testGroupCamelCase
  • FirebirdQBTest::testWhereIn
  • FirebirdQBTest::testOrWhereIn
  • FirebirdQBTest::testWhereNotIn
  • FirebirdQBTest::testOrWhereNotIn
  • FirebirdQBTest::testOrderBy
  • FirebirdQBTest::testOrderByRandom
  • FirebirdQBTest::testGroupBy
  • FirebirdQBTest::testOrWhere
  • FirebirdQBTest::testLike
  • FirebirdQBTest::testOrLike
  • FirebirdQBTest::testOrNotLike
  • FirebirdQBTest::testNotLike
  • FirebirdQBTest::testLikeBefore
  • FirebirdQBTest::testLikeAfter
  • FirebirdQBTest::testJoinWithMultipleWhereValues
  • FirebirdQBTest::testInsert
  • FirebirdQBTest::testInsertArray
  • FirebirdQBTest::testUpdate
  • FirebirdQBTest::testSetArrayUpdate
  • FirebirdQBTest::testWhereSetUpdate
  • FirebirdQBTest::testDelete
  • FirebirdQBTest::testDeleteWithMultipleWhereValues
  • FirebirdQBTest::testCountAllResults2
  • FirebirdQBTest::testBadNumRows
288289290
Covered by 36 test(s):
  • FirebirdTest::testPrepareExecute
  • FirebirdQBTest::testGetWhere
  • FirebirdQBTest::testHaving
  • FirebirdQBTest::testOrHaving
  • FirebirdQBTest::testSelectWhereGet
  • FirebirdQBTest::testSelectFromGet
  • FirebirdQBTest::testSelectFromLimitGet
  • FirebirdQBTest::testSelectWhereGet2
  • FirebirdQBTest::testGroup
  • FirebirdQBTest::testOrGroup
  • FirebirdQBTest::testOrNotGroup
  • FirebirdQBTest::testGroupCamelCase
  • FirebirdQBTest::testWhereIn
  • FirebirdQBTest::testOrWhereIn
  • FirebirdQBTest::testWhereNotIn
  • FirebirdQBTest::testOrWhereNotIn
  • FirebirdQBTest::testOrderBy
  • FirebirdQBTest::testOrderByRandom
  • FirebirdQBTest::testGroupBy
  • FirebirdQBTest::testOrWhere
  • FirebirdQBTest::testLike
  • FirebirdQBTest::testOrLike
  • FirebirdQBTest::testOrNotLike
  • FirebirdQBTest::testNotLike
  • FirebirdQBTest::testLikeBefore
  • FirebirdQBTest::testLikeAfter
  • FirebirdQBTest::testJoinWithMultipleWhereValues
  • FirebirdQBTest::testInsert
  • FirebirdQBTest::testInsertArray
  • FirebirdQBTest::testUpdate
  • FirebirdQBTest::testSetArrayUpdate
  • FirebirdQBTest::testWhereSetUpdate
  • FirebirdQBTest::testDelete
  • FirebirdQBTest::testDeleteWithMultipleWhereValues
  • FirebirdQBTest::testCountAllResults2
  • FirebirdQBTest::testBadNumRows
291292
Covered by 36 test(s):
  • FirebirdTest::testPrepareExecute
  • FirebirdQBTest::testGetWhere
  • FirebirdQBTest::testHaving
  • FirebirdQBTest::testOrHaving
  • FirebirdQBTest::testSelectWhereGet
  • FirebirdQBTest::testSelectFromGet
  • FirebirdQBTest::testSelectFromLimitGet
  • FirebirdQBTest::testSelectWhereGet2
  • FirebirdQBTest::testGroup
  • FirebirdQBTest::testOrGroup
  • FirebirdQBTest::testOrNotGroup
  • FirebirdQBTest::testGroupCamelCase
  • FirebirdQBTest::testWhereIn
  • FirebirdQBTest::testOrWhereIn
  • FirebirdQBTest::testWhereNotIn
  • FirebirdQBTest::testOrWhereNotIn
  • FirebirdQBTest::testOrderBy
  • FirebirdQBTest::testOrderByRandom
  • FirebirdQBTest::testGroupBy
  • FirebirdQBTest::testOrWhere
  • FirebirdQBTest::testLike
  • FirebirdQBTest::testOrLike
  • FirebirdQBTest::testOrNotLike
  • FirebirdQBTest::testNotLike
  • FirebirdQBTest::testLikeBefore
  • FirebirdQBTest::testLikeAfter
  • FirebirdQBTest::testJoinWithMultipleWhereValues
  • FirebirdQBTest::testInsert
  • FirebirdQBTest::testInsertArray
  • FirebirdQBTest::testUpdate
  • FirebirdQBTest::testSetArrayUpdate
  • FirebirdQBTest::testWhereSetUpdate
  • FirebirdQBTest::testDelete
  • FirebirdQBTest::testDeleteWithMultipleWhereValues
  • FirebirdQBTest::testCountAllResults2
  • FirebirdQBTest::testBadNumRows
293294295296297298299300301302303304305306
Covered by 17 test(s):
  • FirebirdTest::testBackupData
  • FirebirdQBTest::testOrWhereIn
  • FirebirdQBTest::testWhereNotIn
  • FirebirdQBTest::testOrWhereNotIn
  • FirebirdQBTest::testLike
  • FirebirdQBTest::testOrLike
  • FirebirdQBTest::testOrNotLike
  • FirebirdQBTest::testNotLike
  • FirebirdQBTest::testLikeBefore
  • FirebirdQBTest::testLikeAfter
  • FirebirdQBTest::testJoinWithMultipleWhereValues
  • FirebirdQBTest::testInsertBatch
  • FirebirdQBTest::testUpdate
  • FirebirdQBTest::testSetArrayUpdate
  • FirebirdQBTest::testWhereSetUpdate
  • FirebirdQBTest::testDeleteWithMultipleWhereValues
  • FirebirdQBTest::testBadNumRows
307
Covered by 17 test(s):
  • FirebirdTest::testBackupData
  • FirebirdQBTest::testOrWhereIn
  • FirebirdQBTest::testWhereNotIn
  • FirebirdQBTest::testOrWhereNotIn
  • FirebirdQBTest::testLike
  • FirebirdQBTest::testOrLike
  • FirebirdQBTest::testOrNotLike
  • FirebirdQBTest::testNotLike
  • FirebirdQBTest::testLikeBefore
  • FirebirdQBTest::testLikeAfter
  • FirebirdQBTest::testJoinWithMultipleWhereValues
  • FirebirdQBTest::testInsertBatch
  • FirebirdQBTest::testUpdate
  • FirebirdQBTest::testSetArrayUpdate
  • FirebirdQBTest::testWhereSetUpdate
  • FirebirdQBTest::testDeleteWithMultipleWhereValues
  • FirebirdQBTest::testBadNumRows
308
Covered by 2 test(s):
  • FirebirdTest::testBackupData
  • FirebirdQBTest::testInsertBatch
309310311
Covered by 17 test(s):
  • FirebirdTest::testBackupData
  • FirebirdQBTest::testOrWhereIn
  • FirebirdQBTest::testWhereNotIn
  • FirebirdQBTest::testOrWhereNotIn
  • FirebirdQBTest::testLike
  • FirebirdQBTest::testOrLike
  • FirebirdQBTest::testOrNotLike
  • FirebirdQBTest::testNotLike
  • FirebirdQBTest::testLikeBefore
  • FirebirdQBTest::testLikeAfter
  • FirebirdQBTest::testJoinWithMultipleWhereValues
  • FirebirdQBTest::testInsertBatch
  • FirebirdQBTest::testUpdate
  • FirebirdQBTest::testSetArrayUpdate
  • FirebirdQBTest::testWhereSetUpdate
  • FirebirdQBTest::testDeleteWithMultipleWhereValues
  • FirebirdQBTest::testBadNumRows
312313314315316317318319320321322323
Covered by 2 test(s):
  • FirebirdTest::testErrorInfo
  • FirebirdQBTest::testResultErrors
324
Covered by 2 test(s):
  • FirebirdTest::testErrorInfo
  • FirebirdQBTest::testResultErrors
325326
Covered by 2 test(s):
  • FirebirdTest::testErrorInfo
  • FirebirdQBTest::testResultErrors
327328329330331332333334335336337338
Covered by 2 test(s):
  • FirebirdTest::testErrorCode
  • FirebirdQBTest::testResultErrors
339340341342343344345346347348349350351352353354
Covered by 1 test(s):
  • FirebirdTest::testPrepareQuery
355356357358359360361362363364365366367368369
Covered by 1 test(s):
  • FirebirdQBTest::testInsertBatch
370371372
Covered by 1 test(s):
  • FirebirdQBTest::testInsertBatch
373374
Covered by 1 test(s):
  • FirebirdQBTest::testInsertBatch
375
Covered by 1 test(s):
  • FirebirdQBTest::testInsertBatch
376377
Covered by 1 test(s):
  • FirebirdQBTest::testInsertBatch
378
Covered by 1 test(s):
  • FirebirdQBTest::testInsertBatch
379
Covered by 1 test(s):
  • FirebirdQBTest::testInsertBatch
380381
Covered by 1 test(s):
  • FirebirdQBTest::testInsertBatch
382383384
Covered by 1 test(s):
  • FirebirdQBTest::testInsertBatch
385386387
Covered by 1 test(s):
  • FirebirdQBTest::testInsertBatch
388
Covered by 1 test(s):
  • FirebirdQBTest::testInsertBatch
389390391
Covered by 1 test(s):
  • FirebirdQBTest::testInsertBatch
392393394395396
Covered by 1 test(s):
  • FirebirdQBTest::testInsertBatch
397398399
<?php
/**
 * Query
 *
 * Free Query Builder / Database Abstraction Layer
 *
 * @package		Query
 * @author		Timothy J. Warren
 * @copyright	Copyright (c) 2012 - 2014
 * @link 		https://github.com/aviat4ion/Query
 * @license		http://philsturgeon.co.uk/code/dbad-license
 */

// --------------------------------------------------------------------------

namespace Query\Drivers\Firebird;

/**
 * Firebird Database class
 *
 * PDO-firebird isn't stable, so this is a wrapper of the fbird_ public functions.
 *
 * @package Query
 * @subpackage Drivers
 */
class Driver extends \Query\AbstractDriver {

	/**
	 * Reference to the last query executed
	 *
	 * @var object
	 */
	protected $statement = NULL;

	/**
	 * Reference to the resource returned by
	 * the last query executed
	 *
	 * @var resource
	 */
	protected $statement_link = NULL;

	/**
	 * Reference to the current transaction
	 *
	 * @var resource
	 */
	protected $trans = NULL;

	/**
	 * Reference to the connection resource
	 *
	 * @var resource
	 */
	protected $conn = NULL;

	/**
	 * Reference to the service resource
	 *
	 * @var resource
	 */
	protected $service = NULL;

	/**
	 * Firebird doesn't have the truncate keyword
	 *
	 * @var bool
	 */
	protected $has_truncate = FALSE;

	/**
	 * Open the link to the database
	 *
	 * @param string $dbpath
	 * @param string $user
	 * @param string $pass
	 * @param array $options
	 * @throws \PDOException
	 */
	public function __construct($dbpath, $user='SYSDBA', $pass='masterkey', array $options = array())
	{
		$connect_function = (isset($options[\PDO::ATTR_PERSISTENT]) && $options[\PDO::ATTR_PERSISTENT] == TRUE)
			? '\\fbird_pconnect'
			: '\\fbird_connect';

		$this->conn = $connect_function($dbpath, $user, $pass, 'utf-8', 0);
		$this->service = \fbird_service_attach('localhost', $user, $pass);

		// Throw an exception to make this match other pdo classes
		if ( ! \is_resource($this->conn)) throw new \PDOException(\fbird_errmsg(), \fbird_errcode(), NULL);

		// Load these classes here because this
		// driver does not call the constructor
		// of DB_PDO, which defines these
		// class variables for the other drivers
		$this->_load_sub_classes();
	}

	// --------------------------------------------------------------------------

	/**
	 * Cleanup some loose ends
	 * @codeCoverageIgnore
	 */
	public function __destruct()
	{
		\fbird_service_detach($this->service);
	}

	// --------------------------------------------------------------------------

	/**
	 * Return service handle
	 *
	 * @return resource
	 */
	public function get_service()
	{
		return $this->service;
	}


	// --------------------------------------------------------------------------

	/**
	 * Execute an sql statement and return number of affected rows
	 *
	 * @param string $sql
	 * @return int
	 */
	public function exec($sql)
	{
		return NULL;
	}

	// --------------------------------------------------------------------------

	/**
	 * Implement for compatibility with PDO
	 *
	 * @param int $attribute
	 * @return mixed
	 */
	public function getAttribute($attribute)
	{
		return NULL;
	}

	// --------------------------------------------------------------------------

	/**
	 * Return whether the current statement is in a transaction
	 *
	 * @return bool
	 */
	public function inTransaction()
	{
		return ! is_null($this->trans);
	}

	// --------------------------------------------------------------------------

	/**
	 * Returns the last value of the specified generator
	 *
	 * @param string $name
	 * @return mixed
	 */
	public function lastInsertId($name = NULL)
	{
		return \fbird_gen_id($name, 0, $this->conn);
	}

	// --------------------------------------------------------------------------

	/**
	 * Wrapper public function to better match PDO
	 *
	 * @param string $sql
	 * @return Result
	 * @throws PDOException
	 */
	public function query($sql = '')
	{

		if (empty($sql)) throw new \PDOException("Query method requires an sql query!", 0, NULL);

		$this->statement_link = (isset($this->trans))
			? \fbird_query($this->trans, $sql)
			: \fbird_query($this->conn, $sql);

		// Throw the error as a exception
		$err_string = \fbird_errmsg() . "Last query:" . $this->get_last_query();
		if ($this->statement_link === FALSE) throw new \PDOException($err_string, \fbird_errcode(), NULL);

		$this->statement = new Result($this->statement_link, $this);

		return $this->statement;
	}

	// --------------------------------------------------------------------------

	/**
	 * Emulate PDO prepare
	 *
	 * @param string $query
	 * @param array $options
	 * @return Result
	 * @throws \PDOException
	 */
	public function prepare($query, $options=array())
	{
		$this->statement_link = \fbird_prepare($this->conn, $query);

		// Throw the error as an exception
		if ($this->statement_link === FALSE) throw new \PDOException(\fbird_errmsg(), \fbird_errcode(), NULL);

		$this->statement = new Result($this->statement_link, $this);

		return $this->statement;
	}

	// --------------------------------------------------------------------------

	/**
	 * Start a database transaction
	 *
	 * @return boolean|null
	 */
	public function beginTransaction()
	{
		return (($this->trans = \fbird_trans($this->conn)) !== NULL) ? TRUE : NULL;
	}

	// --------------------------------------------------------------------------

	/**
	 * Commit a database transaction
	 *
	 * @return bool
	 */
	public function commit()
	{
		$res = \fbird_commit($this->trans);
		$this->trans = NULL;
		return $res;
	}

	// --------------------------------------------------------------------------

	/**
	 * Rollback a transaction
	 *
	 * @return bool
	 */
	public function rollBack()
	{
		$res = \fbird_rollback($this->trans);
		$this->trans = NULL;
		return $res;
	}

	// --------------------------------------------------------------------------

	/**
	 * Set a connection attribute
	 * @param int $attribute
	 * @param mixed $value
	 * @return bool
	 */
	public function setAttribute($attribute, $value)
	{
		return FALSE;
	}

	// --------------------------------------------------------------------------

	/**
	 * Prepare and execute a query
	 *
	 * @param string $sql
	 * @param array $args
	 * @return Result
	 */
	public function prepare_execute($sql, $args)
	{
		$query = $this->prepare($sql);

		// Set the statement in the class variable for easy later access
		$this->statement_link =& $query;

		return $query->execute($args);
	}

	// --------------------------------------------------------------------------

	/**
	 * Method to emulate PDO->quote
	 *
	 * @param string $str
	 * @param int $param_type
	 * @return string
	 */
	public function quote($str, $param_type = \PDO::PARAM_STR)
	{
		if(is_numeric($str))
		{
			return $str;
		}

		return "'".str_replace("'", "''", $str)."'";
	}

	// --------------------------------------------------------------------------

	/**
	 * Method to emulate PDO->errorInfo / PDOStatement->errorInfo
	 *
	 * @return array
	 */
	public function errorInfo()
	{
		$code = \fbird_errcode();
		$msg = \fbird_errmsg();

		return array(0, $code, $msg);
	}

	// --------------------------------------------------------------------------

	/**
	 * Method to emulate PDO->errorCode
	 *
	 * @return array
	 */
	public function errorCode()
	{
		return \fbird_errcode();
	}

	// --------------------------------------------------------------------------

	/**
	 * Bind a prepared query with arguments for executing
	 *
	 * @param string $sql
	 * @param array $params
	 * @return NULL
	 */
	public function prepare_query($sql, $params)
	{
		// You can't bind query statements before execution with
		// the firebird database
		return NULL;
	}

	// --------------------------------------------------------------------------

	/**
	 * Create sql for batch insert
	 *
	 * @param string $table
	 * @param array $data
	 * @return array
	 */
	public function insert_batch($table, $data=array())
	{
		// Each member of the data array needs to be an array
		if ( ! is_array(current($data))) return NULL;

		// Start the block of sql statements
		$sql = "EXECUTE BLOCK AS BEGIN\n";

		$table = $this->quote_table($table);
		$fields = \array_keys(\current($data));

		$insert_template = "INSERT INTO {$table} ("
			. implode(',', $this->quote_ident($fields))
			. ") VALUES (";

		foreach($data as $item)
		{
			// Quote string values
			$vals = array_map(array($this, 'quote'), $item);

			// Add the values in the sql
			$sql .= $insert_template . implode(', ', $vals) . ");\n";
		}

		// End the block of SQL statements
		$sql .= "END";

		// Return a null array value so the query is run as it is,
		// not as a prepared statement, because a prepared statement
		// doesn't work for this type of query in Firebird.
		return array($sql, NULL);
	}
}
// End of firebird_driver.php