Commit fc95ea04 authored by Ryan Herbert's avatar Ryan Herbert Committed by Mikaël Salson

match sqlite syntax

Set MySQL to use pipes for concat just like SQLITE.
parent 4a234b5c
......@@ -217,7 +217,7 @@ def get_sample_set_id_from_results_file(results_file_id):
return sample_set_id
def get_conf_list_select():
return "GROUP_CONCAT(DISTINCT CONCAT(config.id, ';', config.name, ';', fused_file.fused_file))"
return "GROUP_CONCAT(DISTINCT (config.id || ';' || config.name || ';' || fused_file.fused_file))"
def get_config_ids_select():
return "GROUP_CONCAT(DISTINCT config.id)"
......@@ -229,4 +229,4 @@ def get_group_names_select():
return "GROUP_CONCAT(DISTINCT auth_group.role)"
def get_file_sizes_select():
return "GROUP_CONCAT(DISTINCT CONCAT(sequence_file.id, ';', sequence_file.size_file))"
return "GROUP_CONCAT(DISTINCT (sequence_file.id || ';' || sequence_file.size_file))"
......@@ -109,8 +109,9 @@ auth.messages.group_description = 'Group of user %(id)04d - %(first_name)s %(las
from gluon.contrib.login_methods.rpx_account import use_janrain
use_janrain(auth, filename='private/janrain.key')
# TODO: create a custom adapter ?
if defs.DB_ADDRESS.split(':')[0] == 'mysql':
db.executesql("SET sql_mode='PIPES_AS_CONCAT,NO_BACKSLASH_ESCAPES';")
db.executesql("SET sql_mode='PIPES_AS_CONCAT,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'")
#########################################################################
## Define your tables below for example
......
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