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
eeb784a1
Commit
eeb784a1
authored
Jun 25, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added typecast to auto increment PK
fixes #3583
parent
b04e23f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
ActiveRecord.php
framework/db/ActiveRecord.php
+1
-1
No files found.
framework/CHANGELOG.md
View file @
eeb784a1
...
...
@@ -40,6 +40,7 @@ Yii Framework 2 Change Log
-
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)
-
Bug #3583: Added typecast to auto value of primary key on insert of sql active record (cebe)
-
Bug #3591: Fixed incomplete obsolete filling in i18n
`MessageController::saveMessagesToDb()`
(advsm)
-
Bug #3601: Fixed the bug that the refresh URL was not generated correctly by
`Captcha`
(qiangxue, klevron)
-
Bug #3681: Fixed problem with AR::findOne() when a default scope joins another table so that PK name becomes ambigous (cebe)
...
...
framework/db/ActiveRecord.php
View file @
eeb784a1
...
...
@@ -466,7 +466,7 @@ class ActiveRecord extends BaseActiveRecord
if
(
$table
->
sequenceName
!==
null
)
{
foreach
(
$table
->
primaryKey
as
$name
)
{
if
(
$this
->
getAttribute
(
$name
)
===
null
)
{
$id
=
$
db
->
getLastInsertID
(
$table
->
sequenceName
);
$id
=
$
table
->
columns
[
$name
]
->
typecast
(
$db
->
getLastInsertID
(
$table
->
sequenceName
)
);
$this
->
setAttribute
(
$name
,
$id
);
$values
[
$name
]
=
$id
;
break
;
...
...
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