Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
erp5
Commits
646ef35a
Commit
646ef35a
authored
Jun 22, 2016
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQLCatalog: add getOptimizerSwitchKeyList().
parent
6a46887a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
0 deletions
+90
-0
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_select_optimizer_switch.catalog_keys.xml
...5_mysql_innodb/z_select_optimizer_switch.catalog_keys.xml
+5
-0
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_select_optimizer_switch.sql
...l_catalog/erp5_mysql_innodb/z_select_optimizer_switch.sql
+1
-0
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_select_optimizer_switch.xml
...l_catalog/erp5_mysql_innodb/z_select_optimizer_switch.xml
+53
-0
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/template_catalog_method_id_list
...5_mysql_innodb_catalog/bt/template_catalog_method_id_list
+1
-0
product/ZSQLCatalog/SQLCatalog.py
product/ZSQLCatalog/SQLCatalog.py
+30
-0
No files found.
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_select_optimizer_switch.catalog_keys.xml
0 → 100644
View file @
646ef35a
<catalog_method>
<item
key=
"sql_optimizer_switch"
type=
"int"
>
<value>
1
</value>
</item>
</catalog_method>
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_select_optimizer_switch.sql
0 → 100644
View file @
646ef35a
SELECT
@@
optimizer_switch
\ No newline at end of file
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_select_optimizer_switch.xml
0 → 100644
View file @
646ef35a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"SQL"
module=
"Products.ZSQLMethods.SQL"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_col
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
name
</string>
</key>
<value>
<string>
@@optimizer_switch
</string>
</value>
</item>
<item>
<key>
<string>
null
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
t
</string>
</value>
</item>
<item>
<key>
<string>
width
</string>
</key>
<value>
<int>
610
</int>
</value>
</item>
</dictionary>
</list>
</value>
</item>
<item>
<key>
<string>
arguments_src
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
connection_id
</string>
</key>
<value>
<string>
erp5_sql_connection
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
z_select_optimizer_switch
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/template_catalog_method_id_list
View file @
646ef35a
...
...
@@ -130,6 +130,7 @@ erp5_mysql_innodb/z_related_uid_or_parent_uid
erp5_mysql_innodb/z_reserve_uid
erp5_mysql_innodb/z_search_results
erp5_mysql_innodb/z_search_security
erp5_mysql_innodb/z_select_optimizer_switch
erp5_mysql_innodb/z_show_category_columns
erp5_mysql_innodb/z_show_columns
erp5_mysql_innodb/z_show_index
...
...
product/ZSQLCatalog/SQLCatalog.py
View file @
646ef35a
...
...
@@ -474,6 +474,11 @@ class Catalog(Folder,
'type'
:
'selection'
,
'select_variable'
:
'getCatalogMethodIds'
,
'mode'
:
'w'
},
{
'id'
:
'sql_optimizer_switch'
,
'description'
:
'Method to get optimizer_switch value'
,
'type'
:
'selection'
,
'select_variable'
:
'getCatalogMethodIds'
,
'mode'
:
'w'
},
{
'id'
:
'sql_catalog_tables'
,
'description'
:
'Method to get the main catalog tables'
,
'type'
:
'selection'
,
...
...
@@ -599,6 +604,7 @@ class Catalog(Folder,
sql_count_results
=
''
sql_getitem_by_path
=
''
sql_getitem_by_uid
=
''
sql_optimizer_switch
=
''
sql_catalog_tables
=
''
sql_search_tables
=
()
sql_catalog_schema
=
''
...
...
@@ -2899,6 +2905,30 @@ class Catalog(Folder,
}
return
getEngine
().
getContext
(
data
)
def
_getOptimizerSwitch
(
self
):
method_name
=
self
.
sql_optimizer_switch
try
:
method
=
getattr
(
self
,
method_name
)
except
AttributeError
:
pass
else
:
try
:
return
method
()[
0
][
0
]
except
(
ConflictError
,
DatabaseError
):
raise
except
Exception
:
pass
LOG
(
'SQLCatalog'
,
WARNING
,
'getTableIds failed with the method %s'
%
method_name
,
error
=
sys
.
exc_info
())
return
''
security
.
declarePublic
(
'getOptimizerSwitchKeyList'
)
@
transactional_cache_decorator
(
'SQLCatalog.getOptimizerSwitchKeyList'
)
def
getOptimizerSwitchKeyList
(
self
):
return
[
pair
.
split
(
'='
,
1
)[
0
]
for
pair
in
\
self
.
_getOptimizerSwitch
().
split
(
','
)]
InitializeClass
(
Catalog
)
class
CatalogError
(
Exception
):
pass
...
...
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