Commit 7c614ce3 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Support order_by_list in Resource_zGetMovementHistoryList.

Now we have explicit ORDER BY in the outer query so that we no longer need
to disable derived_merge optimizer.
c.f. https://bugs.launchpad.net/maria/+bug/985828
parent e952b40d
...@@ -2015,6 +2015,7 @@ class SimulationTool(BaseTool): ...@@ -2015,6 +2015,7 @@ class SimulationTool(BaseTool):
""" """
kw['movement_list_mode'] = 1 kw['movement_list_mode'] = 1
kw.update(self._getDefaultGroupByParameters(**kw)) kw.update(self._getDefaultGroupByParameters(**kw))
kw['auto_extend_select_list'] = True
sql_kw = self._generateSQLKeywordDict(**kw) sql_kw = self._generateSQLKeywordDict(**kw)
return self.Resource_zGetMovementHistoryList( return self.Resource_zGetMovementHistoryList(
......
...@@ -419,6 +419,7 @@ ...@@ -419,6 +419,7 @@
<key> <string>arguments_src</string> </key> <key> <string>arguments_src</string> </key>
<value> <string>from_expression\r\n <value> <string>from_expression\r\n
from_table_list:list\r\n from_table_list:list\r\n
select_expression\r\n
where_expression\r\n where_expression\r\n
order_by_expression\r\n order_by_expression\r\n
group_by_expression\r\n group_by_expression\r\n
...@@ -512,6 +513,9 @@ SELECT\n ...@@ -512,6 +513,9 @@ SELECT\n
stock.payment_request_uid AS payment_request_uid,\n stock.payment_request_uid AS payment_request_uid,\n
stock.node_uid AS node_uid,\n stock.node_uid AS node_uid,\n
stock.section_uid AS section_uid\n stock.section_uid AS section_uid\n
<dtml-if select_expression>\n
,<dtml-var select_expression>\n
</dtml-if>\n
FROM\n FROM\n
<dtml-if from_expression>\n <dtml-if from_expression>\n
<dtml-var from_expression>\n <dtml-var from_expression>\n
...@@ -623,6 +627,10 @@ LIMIT\n ...@@ -623,6 +627,10 @@ LIMIT\n
</dtml-if>\n </dtml-if>\n
\n \n
) AS q1\n ) AS q1\n
<dtml-if order_by_expression>\n
ORDER BY\n
<dtml-var order_by_expression>\n
</dtml-if>\n
]]></string> </value> ]]></string> </value>
......
...@@ -35,7 +35,6 @@ from DateTime import DateTime ...@@ -35,7 +35,6 @@ from DateTime import DateTime
from Products.ERP5.tests.testAccounting import AccountingTestCase from Products.ERP5.tests.testAccounting import AccountingTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5ReportTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5ReportTestCase
from Products.ERP5Type.tests.utils import todo_erp5
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
...@@ -799,12 +798,9 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -799,12 +798,9 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
dict(source_value=account_module.goods_sales, dict(source_value=account_module.goods_sales,
source_credit=300.0))) source_credit=300.0)))
@todo_erp5
def test_Resource_zGetMovementHistoryList(self): def test_Resource_zGetMovementHistoryList(self):
# TODO: Fix Resource_zGetMovementHistoryList so that we don't need to workaround # Check if Resource_zGetMovementHistoryList works fine with derived_merge optimizer.
# new behaviour of MariaDB. # see https://bugs.launchpad.net/maria/+bug/985828
# Indeed, https://bugs.launchpad.net/maria/+bug/985828 has been marked
# as WONTFIX.
q = self.portal.erp5_sql_connection.manage_test q = self.portal.erp5_sql_connection.manage_test
q("SET optimizer_switch = 'derived_merge=on'") q("SET optimizer_switch = 'derived_merge=on'")
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment