Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
702967b6
Commit
702967b6
authored
Apr 04, 2014
by
Davi Koscianski Vidal
Committed by
lucasvanlierop
Jun 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Applying requested fixes
parent
3b086813
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
10 deletions
+12
-10
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+3
-3
PostgreSqlPlatform.php
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
+5
-1
DBAL630Test.php
tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL630Test.php
+0
-2
AbstractPostgreSqlPlatformTestCase.php
...sts/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php
+4
-4
No files found.
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
702967b6
...
@@ -2245,7 +2245,7 @@ abstract class AbstractPlatform
...
@@ -2245,7 +2245,7 @@ abstract class AbstractPlatform
}
elseif
((
string
)
$field
[
'type'
]
==
'Date'
&&
$field
[
'default'
]
==
$this
->
getCurrentDateSQL
())
{
}
elseif
((
string
)
$field
[
'type'
]
==
'Date'
&&
$field
[
'default'
]
==
$this
->
getCurrentDateSQL
())
{
$default
=
" DEFAULT "
.
$this
->
getCurrentDateSQL
();
$default
=
" DEFAULT "
.
$this
->
getCurrentDateSQL
();
}
elseif
((
string
)
$field
[
'type'
]
==
'Boolean'
)
{
}
elseif
((
string
)
$field
[
'type'
]
==
'Boolean'
)
{
$default
=
" DEFAULT '"
.
$this
->
convertBool
ToSqlLiteral
(
$field
[
'default'
])
.
"'"
;
$default
=
" DEFAULT '"
.
$this
->
convertBool
eans
(
$field
[
'default'
])
.
"'"
;
}
}
}
}
}
}
...
@@ -2604,9 +2604,9 @@ abstract class AbstractPlatform
...
@@ -2604,9 +2604,9 @@ abstract class AbstractPlatform
* @param mixed $item
* @param mixed $item
* @return mixed
* @return mixed
*/
*/
public
function
convertBoolToDbValue
(
$item
)
public
function
convertBool
eans
ToDbValue
(
$item
)
{
{
return
self
::
convertBooleans
(
$item
);
return
$this
->
convertBooleans
(
$item
);
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
View file @
702967b6
...
@@ -725,7 +725,11 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -725,7 +725,11 @@ class PostgreSqlPlatform extends AbstractPlatform
if
(
is_bool
(
$value
)
||
is_numeric
(
$value
))
{
if
(
is_bool
(
$value
)
||
is_numeric
(
$value
))
{
$item
[
$key
]
=
$value
?
1
:
0
;
$item
[
$key
]
=
$value
?
1
:
0
;
}
elseif
(
is_string
(
$value
))
{
}
elseif
(
is_string
(
$value
))
{
$item
[
$key
]
=
(
trim
(
strtolower
(
$value
))
===
'false'
);
if
(
trim
(
strtolower
(
$item
))
===
'false'
)
{
$item
[
$key
]
=
0
;
}
else
{
$item
[
$key
]
=
1
;
}
}
}
}
}
}
else
{
}
else
{
...
...
tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL630Test.php
View file @
702967b6
...
@@ -61,8 +61,6 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -61,8 +61,6 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
public
function
testBooleanConversionBoolParamEmulatedPrepares
()
public
function
testBooleanConversionBoolParamEmulatedPrepares
()
{
{
// $this->markTestIncomplete('There is something missing here, on some machines it fails on some it passes.');
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
true
);
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
true
);
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT
,
true
);
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT
,
true
);
...
...
tests/Doctrine/Tests/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php
View file @
702967b6
...
@@ -295,8 +295,8 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
...
@@ -295,8 +295,8 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
{
{
$platform
=
$this
->
createPlatform
();
$platform
=
$this
->
createPlatform
();
$this
->
assertEquals
(
'true'
,
$platform
->
convertBool
ToSqlLiteral
(
true
));
$this
->
assertEquals
(
'true'
,
$platform
->
convertBool
eans
(
true
));
$this
->
assertEquals
(
'false'
,
$platform
->
convertBool
ToSqlLiteral
(
false
));
$this
->
assertEquals
(
'false'
,
$platform
->
convertBool
eans
(
false
));
}
}
/**
/**
...
@@ -307,8 +307,8 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
...
@@ -307,8 +307,8 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
$platform
=
$this
->
createPlatform
();
$platform
=
$this
->
createPlatform
();
$platform
->
setUseBooleanTrueFalseStrings
(
false
);
$platform
->
setUseBooleanTrueFalseStrings
(
false
);
$this
->
assertEquals
(
'1'
,
$platform
->
convertBool
ToSqlLiteral
(
true
));
$this
->
assertEquals
(
'1'
,
$platform
->
convertBool
eans
(
true
));
$this
->
assertEquals
(
'0'
,
$platform
->
convertBool
ToSqlLiteral
(
false
));
$this
->
assertEquals
(
'0'
,
$platform
->
convertBool
eans
(
false
));
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment