[PATCH 3 of 3] Cast ld values to varchar in user artifacts statement

Wald Commits scm-commit at wald.intevation.org
Wed Jul 24 19:03:49 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1374685413 -7200
# Node ID 86b17c67537458d5a263c9b9e1bb29b820c40b29
# Parent  6f42a62d0cf2a0e97fc4e0ead32d7d9b083c87ad
Cast ld values to varchar in user artifacts statement

    The problem appears to be that now with v in the artifactsdb as
    a TEXT datatype that we get CLOBS as a result here. To make
    the old stuff work we cast the ld_ values that are evalutated
    in datacage functions back to varchar and thus to strings.

diff -r 6f42a62d0cf2 -r 86b17c675374 artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Wed Jul 24 18:20:16 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Wed Jul 24 19:03:33 2013 +0200
@@ -2448,17 +2448,21 @@
 
     <dc:macro name="all-user-artifacts">
         <dc:context connection="user">
-        <dc:comment>Select collections and masterartifacts.</dc:comment>
+          <dc:comment>Select collections and masterartifacts.
+            XXX: The cast is a quick hack because the ld_* values are
+            now TEXT fields. To properly fix / asses the problems here
+            an SLT evaluation is needed.
+          </dc:comment>
         <dc:statement>
           SELECT c.name                     AS collection_name,
                  ma.id                      AS a_id,
                  ma.state                   AS a_state,
                  ma.gid                     AS a_gid,
                  ma.creation                AS a_creation,
-                 COALESCE(ma.ld_mode, '')      AS ld_m,
-                 COALESCE(ma.ld_locations, '') AS ld_l,
-                 COALESCE(ma.ld_from, '')      AS ld_f,
-                 COALESCE(ma.ld_to, '')        AS ld_t,
+                 CAST(COALESCE(ma.ld_mode, '') AS VARCHAR(255)) AS ld_m,
+                 CAST(COALESCE(ma.ld_locations, '') AS VARCHAR(255)) AS ld_l,
+                 CAST(COALESCE(ma.ld_from, '') AS VARCHAR(255)) AS ld_f,
+                 CAST(COALESCE(ma.ld_to, '') AS VARCHAR(255)) AS ld_t,
                  o.name                        AS out_name,
                  o.id                          AS out_id,
                  f.name                        AS facet_name,


More information about the Dive4elements-commits mailing list