Commit graph

454 commits

Author SHA1 Message Date
Ber Clausen
5da05d9216 Remove unneeded test inside conditional. 2013-11-11 23:27:50 -03:00
Ber Clausen
f16695db5f Move variables to logical blocks.
Unindent to ease readability, and avoid assigning variables when
unneeded.
Free a little memory before entering to recursive intensive loops.
2013-11-11 23:27:50 -03:00
Ber Clausen
fdb4b11d0b Remove unnecessary call to getDataSource(). 2013-11-11 23:27:50 -03:00
Ber Clausen
c9e0131d6a Only generate query data for hasOne and belongsTo associations.
Avoid calling generateAssociationQuery():

* when the return value will never be usefull (True in this case)
* to avoid polluting $queryData with uneeded fields

Later, the SQL statement for the primary, and 'hasOne' plus 'belongsTo'
relationships, is built.
2013-11-11 23:27:50 -03:00
Ber Clausen
2532228844 Improve readability and optimize minimizing variable lookups. 2013-11-11 23:27:49 -03:00
mark_story
afd182898f Merge branch 'master' into 2.5 2013-11-01 16:54:57 -04:00
mark_story
9e4ac31dc3 Correctly identifier quote column names before adding them to queries.
Closes #2248
2013-10-31 19:53:42 -04:00
mark_story
aaac360833 Merge branch 'master' into 2.5 2013-10-30 14:58:20 -04:00
Zach Gambino
927a4933d1 Fix for #2247 | Use correct column when calculating next sequence value
See #2247 for more details.
2013-10-30 11:25:06 -07:00
mark_story
16be5722ba Fix COUNT(DISTINCT x) queries from getting corrupted in Sqlserver.
Add into the tower of hacks that is the SQL generation and stop breaking
COUNT(DISTINCT foo) style queries. Previously these would be converted
into DISTINCT COUNT(foo) which will give the non-distinct results.
2013-10-29 23:01:55 -04:00
mark_story
0f8dae55c9 Add missing trim() around Sqlserver queries.
This solves issues with queries failing.

Fixes #2222
2013-10-29 23:01:49 -04:00
ADmad
d9ca148499 Merge branch 'master' into 2.5
Conflicts:
	CONTRIBUTING.md
	lib/Cake/Model/Model.php
	lib/Cake/VERSION.txt
2013-10-30 02:34:09 +05:30
mark_story
a098ff28b8 Update doc block and remove inline assignment. 2013-10-29 12:32:20 -04:00
Robert Sworder
940a51b5fa Update definition of an empty model. 2013-10-25 15:12:03 +01:00
Frank de Graaf
ab89f6ec97 Makes DboSource less string dependent. 2013-10-22 16:43:32 +02:00
Mark Story
ce74153389 Merge pull request #1691 from uzyn/2.5-decimal
Add support for decimal type in Schema.

Fixes #3171
2013-10-14 08:36:15 -07:00
Jose Lorenzo Rodriguez
9673048c30 Merge branch 'master' of github.com:k-halaburda/cakephp into k-halaburda-master 2013-10-12 01:03:20 +02:00
José Lorenzo Rodríguez
8cdbafd312 Merge pull request #1631 from ovidiupruteanu/patch-2
flushMethodCache not working if called before cacheMethod
2013-10-11 15:56:19 -07:00
José Lorenzo Rodríguez
6c2eb6e7c6 Merge pull request #1546 from rchavik/2.3-sqlite-truncate
Sqlite::truncate(): Verify `sqlite_sequence` exists before _execute()
2013-10-11 15:52:49 -07:00
U-Zyn Chua
e527506c39 MySQL: Numeric data type now supported under decimal column. #3171 2013-09-28 23:05:53 +08:00
U-Zyn Chua
73cae88a6f SQL Server support of numeric type. #3171
Float & real map to float. Numeric & decimal map to numeric.
2013-09-28 22:48:37 +08:00
U-Zyn Chua
c74c8d49a1 Decimal support for SQLite. #3171 2013-09-28 14:36:55 +08:00
U-Zyn Chua
a1a3e70039 Decimal support for PostgreSQL. #3171 2013-09-28 14:07:00 +08:00
Bryan Crowe
bb65765d70 Updated additional references of Cake to CakePHP 2013-09-27 21:31:35 -04:00
U-Zyn Chua
7fb51ab50f Decimal support for MySQL. #3171 2013-09-28 09:23:46 +08:00
Andy Hobbs
0f7d6a90a1 Ticket 4108
- Added schemaName to DboSource::fields() method cache key to fix bug with changing schema name
2013-09-26 11:56:14 +01:00
ber clausen
39bc8dff97 Wrong signature. 2013-09-25 09:12:49 -03:00
Bryan Crowe
7d7954ce18 Replaced all is_a() calls with instanceof operator 2013-09-24 21:08:06 -04:00
euromark
653aed7701 is_a() to instance of - completes PR 1669 2013-09-24 22:57:51 +02:00
euromark
382f75dbfc cs corrections, bool to boolean and int to integer. 2013-09-17 14:44:34 +02:00
ovidiupruteanu
f416a321c7 flushMethodCache not working if called before cacheMethod
When calling flushMethodCache it correctly empties self::$methodCache but if cacheMethod is called afterwards self::$methodCache gets populated with data from the Cache.
2013-09-12 22:02:39 +03:00
Marc Würth
446792987a Replaced two elseifs by if in sqlserver datasource 2013-09-11 23:15:05 +02:00
ovidiupruteanu
b58940e9b5 Fixed handling null values in Sqlserver->value
The value function quoted a null value as N'' instead of NULL.
As a result is produced queries like [name] IS N'' instead of [name] IS NULL which resulted in an SQL error.
2013-09-09 16:33:54 +03:00
euromark
959988cfa1 Remove last yoda conditions as per coding standards guidelines. 2013-09-06 18:36:57 +02:00
Mark Story
0f528c279a Merge pull request #1614 from okinaka/2.x-disused-code
Postgres::truncate(): Delete disused code.
2013-09-05 18:16:22 -07:00
mark_story
6a6371b2d4 Fix CROSS JOINs
While seldomly used, CROSS joins should not generate invalid SQL.

Fixes #4050
2013-09-05 12:45:48 -04:00
okinaka
e0f24d0ade Postgres::truncate(): Delete disused code. 2013-09-05 14:11:50 +09:00
mark_story
f18d354f55 Merge branch 'master' into 2.4 2013-08-28 12:35:07 -04:00
mark_story
c1ae41da51 Correctly generate bigint primary keys in sqlite.
generate bigint primary keys correctly. Autoincrement cannot be set as
it only works with INTEGER columns[1]. I decided to use some string
manipulations as the entire SQL generation bits are a bit janky and I've
already re-written them for 3.0.

[1] https://www.sqlite.org/autoinc.html

Closes #GH-1552
2013-08-27 18:11:04 -04:00
mark_story
53d265cfba Merge branch 'master' into 2.4 2013-08-23 12:56:43 -04:00
mark_story
faa2cbd3c3 Remove session.auto_start configuration.
It now fails in PHP >= 5.5.2 . Also it never did anything in earlier
versions as the session would have already been started if auto_start
was true.

Fixes #4010
2013-08-21 13:18:44 -04:00
Rachman Chavik
9d8bb8c047 Sqlite::truncate(): Verify sqlite_sequence exists before _execute()
`sqlite_sequence` is a dynamic table that's only available when a table in
the database use an auto increment field.  For some cases, eg: databases that
exclusively use uuid for primary keys, this table won't exist and
truncate() call will fail with:

  Error: SQLSTATE[HY000]: General error: 1 no such table: sqlite_sequence
2013-08-21 16:34:21 +07:00
mark_story
0f2d59d987 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Network/CakeResponse.php
	lib/Cake/TestSuite/CakeTestCase.php
2013-08-18 23:10:08 -04:00
euromark
6cf147e8c8 unify null checks - avoid method call in favor of strict check 2013-08-16 20:12:49 +02:00
dmromanov
7989bad5b7 Corrected codestyle 2013-08-16 14:12:27 +04:00
dmromanov
56ef44f495 Excluded method names from several tanslation strings
Removed unnecessary sprintfs
2013-08-16 13:42:28 +04:00
k-halaburda
0c1dbded67 Added some test for related model afterFind callback 2013-08-13 10:19:48 +02:00
k-halaburda
bb13af683b Added some test for related model afterFind callback 2013-08-13 10:19:20 +02:00
mark_story
26769edd04 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Utility/CakeTime.php
	lib/Cake/VERSION.txt
2013-08-12 14:39:02 -04:00
mark_story
6ce10b28c9 Update doc blocks. 2013-08-12 14:37:43 -04:00