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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
b04e23f8
Commit
b04e23f8
authored
Jun 25, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use native suppport for batch insert in SQLite >= 3.7.11
fixes #3559
parent
7b13c370
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
QueryBuilder.php
framework/db/sqlite/QueryBuilder.php
+7
-0
No files found.
framework/CHANGELOG.md
View file @
b04e23f8
...
...
@@ -36,6 +36,7 @@ Yii Framework 2 Change Log
-
Bug #3478: Fixed yii
\c
onsole
\C
ontroller::select accept empty input as '0' value (lynicidn)
-
Bug #3522: Fixed BaseFileHelper::normalizePath to allow a (.) for the current path. (skotos)
-
Bug #3548: Fixed the bug that X-Rate-Limit-Remaining header is always zero when using RateLimiter (qiangxue)
-
Bug #3559: Use native support for batchInsert in SQLite versions >= 3.7.11 and avoid limitations of the fallback (cebe)
-
Bug #3564: Fixed the bug that primary key columns should not take default values from schema (qiangxue)
-
Bug #3567: Fixed the bug that smallint was treated as string for PostgreSQL (qiangxue)
-
Bug #3578: Fixed postgreSQL column type detection, added missing types (MDMunir, cebe)
...
...
framework/db/sqlite/QueryBuilder.php
View file @
b04e23f8
...
...
@@ -41,6 +41,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
Schema
::
TYPE_MONEY
=>
'decimal(19,4)'
,
];
/**
* Generates a batch INSERT SQL statement.
* For example,
...
...
@@ -62,6 +63,12 @@ class QueryBuilder extends \yii\db\QueryBuilder
*/
public
function
batchInsert
(
$table
,
$columns
,
$rows
)
{
// SQLite supports batch insert natively since 3.7.11
// http://www.sqlite.org/releaselog/3_7_11.html
if
(
version_compare
(
\SQLite3
::
version
()[
'versionString'
],
'3.7.11'
,
'>='
))
{
return
parent
::
batchInsert
(
$table
,
$columns
,
$rows
);
}
if
((
$tableSchema
=
$this
->
db
->
getTableSchema
(
$table
))
!==
null
)
{
$columnSchemas
=
$tableSchema
->
columns
;
}
else
{
...
...
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