Merge lp:~hartmut-php/eventum/no-mysql-functions into lp:eventum
- no-mysql-functions
- Merge into trunk
Proposed by
Elan Ruusamäe
Status: | Merged |
---|---|
Merge reported by: | Elan Ruusamäe |
Merged at revision: | not available |
Proposed branch: | lp:~hartmut-php/eventum/no-mysql-functions |
Merge into: | lp:eventum |
Diff against target: |
214 lines (+26/-20) (has conflicts) 11 files modified
lib/eventum/class.custom_field.php (+1/-1) lib/eventum/class.draft.php (+1/-1) lib/eventum/class.email_account.php (+1/-1) lib/eventum/class.mail_queue.php (+6/-0) lib/eventum/class.news.php (+1/-1) lib/eventum/class.note.php (+1/-1) lib/eventum/class.notification.php (+1/-1) lib/eventum/class.report.php (+1/-1) lib/eventum/class.search.php (+2/-2) lib/eventum/class.stats.php (+9/-9) lib/eventum/class.support.php (+2/-2) Text conflict in lib/eventum/class.mail_queue.php |
To merge this branch: | bzr merge lp:~hartmut-php/eventum/no-mysql-functions |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Elan Ruusamäe | Pending | ||
Review via email: mp+236236@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Elan Ruusamäe (glen666) wrote : | # |
Revision history for this message
Elan Ruusamäe (glen666) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/eventum/class.custom_field.php' | |||
2 | --- lib/eventum/class.custom_field.php 2014-09-04 21:31:57 +0000 | |||
3 | +++ lib/eventum/class.custom_field.php 2014-09-27 20:11:45 +0000 | |||
4 | @@ -1747,7 +1747,7 @@ | |||
5 | 1747 | 1747 | ||
6 | 1748 | public function getDBValueFieldSQL() | 1748 | public function getDBValueFieldSQL() |
7 | 1749 | { | 1749 | { |
9 | 1750 | return "(IF(fld_type = 'date', icf_value_date, IF(fld_type = 'integer', icf_value_integer, icf_value)))"; | 1750 | return "(CASE WHEN fld_type = 'date' THEN icf_value_date ELSE WHEN fld_type = 'integer' THEN icf_value_integer ELSE icf_value END)"; |
10 | 1751 | } | 1751 | } |
11 | 1752 | 1752 | ||
12 | 1753 | /** | 1753 | /** |
13 | 1754 | 1754 | ||
14 | === modified file 'lib/eventum/class.draft.php' | |||
15 | --- lib/eventum/class.draft.php 2014-09-04 21:31:57 +0000 | |||
16 | +++ lib/eventum/class.draft.php 2014-09-27 20:11:45 +0000 | |||
17 | @@ -397,7 +397,7 @@ | |||
18 | 397 | emd_status = 'pending' | 397 | emd_status = 'pending' |
19 | 398 | ORDER BY | 398 | ORDER BY |
20 | 399 | emd_id ASC | 399 | emd_id ASC |
22 | 400 | LIMIT " . ($sequence - 1) . ", 1"; | 400 | LIMIT 1 OFFSET " . ($sequence - 1); |
23 | 401 | $res = DB_Helper::getInstance()->getOne($stmt); | 401 | $res = DB_Helper::getInstance()->getOne($stmt); |
24 | 402 | if (PEAR::isError($res)) { | 402 | if (PEAR::isError($res)) { |
25 | 403 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); | 403 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); |
26 | 404 | 404 | ||
27 | === modified file 'lib/eventum/class.email_account.php' | |||
28 | --- lib/eventum/class.email_account.php 2014-09-04 21:31:57 +0000 | |||
29 | +++ lib/eventum/class.email_account.php 2014-09-27 20:11:45 +0000 | |||
30 | @@ -428,7 +428,7 @@ | |||
31 | 428 | WHERE | 428 | WHERE |
32 | 429 | ema_prj_id=" . Misc::escapeInteger($prj_id) . " | 429 | ema_prj_id=" . Misc::escapeInteger($prj_id) . " |
33 | 430 | LIMIT | 430 | LIMIT |
35 | 431 | 0, 1"; | 431 | 1 OFFSET 0"; |
36 | 432 | $res = DB_Helper::getInstance()->getOne($stmt); | 432 | $res = DB_Helper::getInstance()->getOne($stmt); |
37 | 433 | if (PEAR::isError($res)) { | 433 | if (PEAR::isError($res)) { |
38 | 434 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); | 434 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); |
39 | 435 | 435 | ||
40 | === modified file 'lib/eventum/class.mail_queue.php' | |||
41 | --- lib/eventum/class.mail_queue.php 2014-09-04 21:31:57 +0000 | |||
42 | +++ lib/eventum/class.mail_queue.php 2014-09-27 20:11:45 +0000 | |||
43 | @@ -307,12 +307,18 @@ | |||
44 | 307 | WHERE | 307 | WHERE |
45 | 308 | maq_status='$status' | 308 | maq_status='$status' |
46 | 309 | ORDER BY | 309 | ORDER BY |
47 | 310 | <<<<<<< TREE | ||
48 | 310 | maq_id ASC"; | 311 | maq_id ASC"; |
49 | 311 | 312 | ||
50 | 312 | if ($limit !== false) { | 313 | if ($limit !== false) { |
51 | 313 | $sql .= " LIMIT 0, $limit"; | 314 | $sql .= " LIMIT 0, $limit"; |
52 | 314 | } | 315 | } |
53 | 315 | 316 | ||
54 | 317 | ======= | ||
55 | 318 | maq_id ASC | ||
56 | 319 | LIMIT | ||
57 | 320 | $limit OFFSET 0"; | ||
58 | 321 | >>>>>>> MERGE-SOURCE | ||
59 | 316 | $res = DB_Helper::getInstance()->getCol($sql); | 322 | $res = DB_Helper::getInstance()->getCol($sql); |
60 | 317 | if (PEAR::isError($res)) { | 323 | if (PEAR::isError($res)) { |
61 | 318 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); | 324 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); |
62 | 319 | 325 | ||
63 | === modified file 'lib/eventum/class.news.php' | |||
64 | --- lib/eventum/class.news.php 2014-09-04 20:32:55 +0000 | |||
65 | +++ lib/eventum/class.news.php 2014-09-27 20:11:45 +0000 | |||
66 | @@ -51,7 +51,7 @@ | |||
67 | 51 | ORDER BY | 51 | ORDER BY |
68 | 52 | nws_created_date DESC | 52 | nws_created_date DESC |
69 | 53 | LIMIT | 53 | LIMIT |
71 | 54 | 0, 3"; | 54 | 3 OFFSET 0"; |
72 | 55 | $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC); | 55 | $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC); |
73 | 56 | if (PEAR::isError($res)) { | 56 | if (PEAR::isError($res)) { |
74 | 57 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); | 57 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); |
75 | 58 | 58 | ||
76 | === modified file 'lib/eventum/class.note.php' | |||
77 | --- lib/eventum/class.note.php 2014-09-04 21:31:57 +0000 | |||
78 | +++ lib/eventum/class.note.php 2014-09-27 20:11:45 +0000 | |||
79 | @@ -244,7 +244,7 @@ | |||
80 | 244 | not_removed = 0 | 244 | not_removed = 0 |
81 | 245 | ORDER BY | 245 | ORDER BY |
82 | 246 | not_created_date ASC | 246 | not_created_date ASC |
84 | 247 | LIMIT " . ($sequence - 1) . ", 1"; | 247 | LIMIT 1 OFFSET " . ($sequence - 1); |
85 | 248 | $res = DB_Helper::getInstance()->getOne($stmt); | 248 | $res = DB_Helper::getInstance()->getOne($stmt); |
86 | 249 | if (PEAR::isError($res)) { | 249 | if (PEAR::isError($res)) { |
87 | 250 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); | 250 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); |
88 | 251 | 251 | ||
89 | === modified file 'lib/eventum/class.notification.php' | |||
90 | --- lib/eventum/class.notification.php 2014-09-04 21:31:57 +0000 | |||
91 | +++ lib/eventum/class.notification.php 2014-09-27 20:11:45 +0000 | |||
92 | @@ -72,7 +72,7 @@ | |||
93 | 72 | public static function getSubscribedEmails($issue_id, $type = false) | 72 | public static function getSubscribedEmails($issue_id, $type = false) |
94 | 73 | { | 73 | { |
95 | 74 | $stmt = "SELECT | 74 | $stmt = "SELECT |
97 | 75 | IF(usr_id <> 0, usr_email, sub_email) AS email | 75 | CASE usr_id <> 0 THEN usr_email ELSE sub_email END AS email |
98 | 76 | FROM | 76 | FROM |
99 | 77 | ( | 77 | ( |
100 | 78 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "subscription"; | 78 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "subscription"; |
101 | 79 | 79 | ||
102 | === modified file 'lib/eventum/class.report.php' | |||
103 | --- lib/eventum/class.report.php 2014-09-04 20:59:49 +0000 | |||
104 | +++ lib/eventum/class.report.php 2014-09-27 20:11:45 +0000 | |||
105 | @@ -890,7 +890,7 @@ | |||
106 | 890 | break; | 890 | break; |
107 | 891 | case "dow": | 891 | case "dow": |
108 | 892 | $format = '%W'; | 892 | $format = '%W'; |
110 | 893 | $order_by = "IF(DATE_FORMAT(%1\$s, '%%w') = 0, 7, DATE_FORMAT(%1\$s, '%%w'))"; | 893 | $order_by = "CASE WHEN DATE_FORMAT(%1\$s, '%%w') = 0 THEN 7 ELSE DATE_FORMAT(%1\$s, '%%w') END"; |
111 | 894 | break; | 894 | break; |
112 | 895 | case "week": | 895 | case "week": |
113 | 896 | if ($type == "aggregate") { | 896 | if ($type == "aggregate") { |
114 | 897 | 897 | ||
115 | === modified file 'lib/eventum/class.search.php' | |||
116 | --- lib/eventum/class.search.php 2014-09-04 17:37:16 +0000 | |||
117 | +++ lib/eventum/class.search.php 2014-09-27 20:11:45 +0000 | |||
118 | @@ -265,7 +265,7 @@ | |||
119 | 265 | iss_last_internal_action_date, | 265 | iss_last_internal_action_date, |
120 | 266 | iss_last_internal_action_type, | 266 | iss_last_internal_action_type, |
121 | 267 | " . Issue::getLastActionFields() . ", | 267 | " . Issue::getLastActionFields() . ", |
123 | 268 | IF(iss_last_internal_action_date > iss_last_public_action_date, 'internal', 'public') AS action_type, | 268 | CASE WHEN iss_last_internal_action_date > iss_last_public_action_date THEN 'internal' ELSE 'public' END AS action_type, |
124 | 269 | iss_private, | 269 | iss_private, |
125 | 270 | usr_full_name, | 270 | usr_full_name, |
126 | 271 | iss_percent_complete, | 271 | iss_percent_complete, |
127 | @@ -397,7 +397,7 @@ | |||
128 | 397 | $total_rows = Pager::getTotalRows($stmt); | 397 | $total_rows = Pager::getTotalRows($stmt); |
129 | 398 | $stmt .= " | 398 | $stmt .= " |
130 | 399 | LIMIT | 399 | LIMIT |
132 | 400 | " . Misc::escapeInteger($start) . ", " . Misc::escapeInteger($max); | 400 | " . Misc::escapeInteger($max) . " OFFSET " . Misc::escapeInteger($start); |
133 | 401 | $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC); | 401 | $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC); |
134 | 402 | if (PEAR::isError($res)) { | 402 | if (PEAR::isError($res)) { |
135 | 403 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); | 403 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); |
136 | 404 | 404 | ||
137 | === modified file 'lib/eventum/class.stats.php' | |||
138 | --- lib/eventum/class.stats.php 2014-09-04 20:32:55 +0000 | |||
139 | +++ lib/eventum/class.stats.php 2014-09-27 20:11:45 +0000 | |||
140 | @@ -230,8 +230,8 @@ | |||
141 | 230 | $stmt = "SELECT | 230 | $stmt = "SELECT |
142 | 231 | DISTINCT iss_prc_id, | 231 | DISTINCT iss_prc_id, |
143 | 232 | prc_title, | 232 | prc_title, |
146 | 233 | SUM(IF(sta_is_closed=0, 1, 0)) AS total_open_items, | 233 | SUM(CASE WHEN sta_is_closed=0 THEN 1 ELSE 0 END) AS total_open_items, |
147 | 234 | SUM(IF(sta_is_closed=1, 1, 0)) AS total_closed_items | 234 | SUM(CASE WHEN sta_is_closed=1 THEN 1 ELSE 0 END) AS total_closed_items |
148 | 235 | FROM | 235 | FROM |
149 | 236 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue, | 236 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue, |
150 | 237 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_category, | 237 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_category, |
151 | @@ -272,8 +272,8 @@ | |||
152 | 272 | $stmt = "SELECT | 272 | $stmt = "SELECT |
153 | 273 | DISTINCT iss_pre_id, | 273 | DISTINCT iss_pre_id, |
154 | 274 | pre_title, | 274 | pre_title, |
157 | 275 | SUM(IF(sta_is_closed=0, 1, 0)) AS total_open_items, | 275 | SUM(CASE WHEN sta_is_closed=0 THEN 1 ELSE 0 END) AS total_open_items, |
158 | 276 | SUM(IF(sta_is_closed=1, 1, 0)) AS total_closed_items | 276 | SUM(CASE WHEN sta_is_closed=1 THEN 1 ELSE 0 END) AS total_closed_items |
159 | 277 | FROM | 277 | FROM |
160 | 278 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue, | 278 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue, |
161 | 279 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_release, | 279 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_release, |
162 | @@ -350,8 +350,8 @@ | |||
163 | 350 | $stmt = "SELECT | 350 | $stmt = "SELECT |
164 | 351 | DISTINCT iss_pri_id, | 351 | DISTINCT iss_pri_id, |
165 | 352 | pri_title, | 352 | pri_title, |
168 | 353 | SUM(IF(sta_is_closed=0, 1, 0)) AS total_open_items, | 353 | SUM(CASE WHEN sta_is_closed=0 THEN 1 ELSE 0 END) AS total_open_items, |
169 | 354 | SUM(IF(sta_is_closed=1, 1, 0)) AS total_closed_items | 354 | SUM(CASE WHEN sta_is_closed=1 THEN 1 ELSE 0 END) AS total_closed_items |
170 | 355 | FROM | 355 | FROM |
171 | 356 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue, | 356 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue, |
172 | 357 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_priority, | 357 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_priority, |
173 | @@ -430,8 +430,8 @@ | |||
174 | 430 | $stmt = "SELECT | 430 | $stmt = "SELECT |
175 | 431 | DISTINCT isu_usr_id, | 431 | DISTINCT isu_usr_id, |
176 | 432 | usr_full_name, | 432 | usr_full_name, |
179 | 433 | SUM(IF(sta_is_closed=0, 1, 0)) AS total_open_items, | 433 | SUM(CASE WHEN sta_is_closed=0 THEN 1 ELSE 0 END) AS total_open_items, |
180 | 434 | SUM(IF(sta_is_closed=1, 1, 0)) AS total_closed_items | 434 | SUM(CASE WHEN sta_is_closed=1 THEN 1 ELSE 0 END) AS total_closed_items |
181 | 435 | FROM | 435 | FROM |
182 | 436 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue, | 436 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue, |
183 | 437 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user, | 437 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user, |
184 | @@ -471,7 +471,7 @@ | |||
185 | 471 | { | 471 | { |
186 | 472 | $prj_id = Auth::getCurrentProject(); | 472 | $prj_id = Auth::getCurrentProject(); |
187 | 473 | $stmt = "SELECT | 473 | $stmt = "SELECT |
189 | 474 | IF(sup_iss_id > 0, 'associated', 'unassociated') type, | 474 | CASE WHEN sup_iss_id > 0 THEN 'associated' ELSE 'unassociated' END AS type, |
190 | 475 | COUNT(*) AS total_items | 475 | COUNT(*) AS total_items |
191 | 476 | FROM | 476 | FROM |
192 | 477 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "support_email, | 477 | " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "support_email, |
193 | 478 | 478 | ||
194 | === modified file 'lib/eventum/class.support.php' | |||
195 | --- lib/eventum/class.support.php 2014-09-04 21:31:57 +0000 | |||
196 | +++ lib/eventum/class.support.php 2014-09-27 20:11:45 +0000 | |||
197 | @@ -1308,7 +1308,7 @@ | |||
198 | 1308 | $total_rows = Pager::getTotalRows($stmt); | 1308 | $total_rows = Pager::getTotalRows($stmt); |
199 | 1309 | $stmt .= " | 1309 | $stmt .= " |
200 | 1310 | LIMIT | 1310 | LIMIT |
202 | 1311 | " . Misc::escapeInteger($start) . ", " . Misc::escapeInteger($max); | 1311 | " . Misc::escapeInteger($max) . " OFFSET " . Misc::escapeInteger($start); |
203 | 1312 | $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC); | 1312 | $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC); |
204 | 1313 | if (PEAR::isError($res)) { | 1313 | if (PEAR::isError($res)) { |
205 | 1314 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); | 1314 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); |
206 | @@ -1658,7 +1658,7 @@ | |||
207 | 1658 | sup_iss_id = " . Misc::escapeInteger($issue_id) . " | 1658 | sup_iss_id = " . Misc::escapeInteger($issue_id) . " |
208 | 1659 | ORDER BY | 1659 | ORDER BY |
209 | 1660 | sup_id | 1660 | sup_id |
211 | 1661 | LIMIT " . (Misc::escapeInteger($sequence) - 1) . ", 1"; | 1661 | LIMIT 1 OFFSET " . (Misc::escapeInteger($sequence) - 1); |
212 | 1662 | $res = DB_Helper::getInstance()->getRow($stmt); | 1662 | $res = DB_Helper::getInstance()->getRow($stmt); |
213 | 1663 | if (PEAR::isError($res)) { | 1663 | if (PEAR::isError($res)) { |
214 | 1664 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); | 1664 | Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); |
merged in git /github. com/eventum/ eventum/ commit/ 312b0d00d35ac29 1b758b574e967ed fbad6340ed
https:/