Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
PSDI Army
yii2
Commits
f1dd83e2
Commit
f1dd83e2
authored
Aug 08, 2014
by
Nikitin Vitaly
Committed by
Carsten Brandt
Aug 12, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test that are making sure batchInsert boolean values in PostgreSQL isn't failing with errors
close #4655
parent
70e0115d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
postgres.sql
tests/unit/data/postgres.sql
+6
-0
PostgreSQLCommandTest.php
tests/unit/framework/db/pgsql/PostgreSQLCommandTest.php
+15
-0
No files found.
tests/unit/data/postgres.sql
View file @
f1dd83e2
...
@@ -16,6 +16,7 @@ DROP TABLE IF EXISTS "profile" CASCADE;
...
@@ -16,6 +16,7 @@ DROP TABLE IF EXISTS "profile" CASCADE;
DROP
TABLE
IF
EXISTS
"type"
CASCADE
;
DROP
TABLE
IF
EXISTS
"type"
CASCADE
;
DROP
TABLE
IF
EXISTS
"null_values"
CASCADE
;
DROP
TABLE
IF
EXISTS
"null_values"
CASCADE
;
DROP
TABLE
IF
EXISTS
"constraints"
CASCADE
;
DROP
TABLE
IF
EXISTS
"constraints"
CASCADE
;
DROP
TABLE
IF
EXISTS
"bool_values"
CASCADE
;
CREATE
TABLE
"constraints"
CREATE
TABLE
"constraints"
(
(
...
@@ -113,6 +114,11 @@ CREATE TABLE "type" (
...
@@ -113,6 +114,11 @@ CREATE TABLE "type" (
bit_col
BIT
(
8
)
NOT
NULL
DEFAULT
B
'10000010'
bit_col
BIT
(
8
)
NOT
NULL
DEFAULT
B
'10000010'
);
);
CREATE
TABLE
"bool_values"
(
id
serial
not
null
primary
key
,
bool_col
bool
);
INSERT
INTO
"profile"
(
description
)
VALUES
(
'profile customer 1'
);
INSERT
INTO
"profile"
(
description
)
VALUES
(
'profile customer 1'
);
INSERT
INTO
"profile"
(
description
)
VALUES
(
'profile customer 3'
);
INSERT
INTO
"profile"
(
description
)
VALUES
(
'profile customer 3'
);
...
...
tests/unit/framework/db/pgsql/PostgreSQLCommandTest.php
View file @
f1dd83e2
...
@@ -19,4 +19,18 @@ class PostgreSQLCommandTest extends CommandTest
...
@@ -19,4 +19,18 @@ class PostgreSQLCommandTest extends CommandTest
$command
=
$db
->
createCommand
(
$sql
);
$command
=
$db
->
createCommand
(
$sql
);
$this
->
assertEquals
(
'SELECT "id", "t"."name" FROM "customer" t'
,
$command
->
sql
);
$this
->
assertEquals
(
'SELECT "id", "t"."name" FROM "customer" t'
,
$command
->
sql
);
}
}
public
function
testBatchInsert
()
{
parent
::
testBatchInsert
();
$command
=
$this
->
getConnection
()
->
createCommand
();
$command
->
batchInsert
(
'bool_values'
,
[
'bool_col'
],
[
[
true
],
[
false
],
]
);
$this
->
assertEquals
(
2
,
$command
->
execute
());
}
}
}
\ No newline at end of file
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