replace all occurrences of changed column name
authorGil Moskowitz <gmoskowitz@xtuple.com>
Wed, 17 Sep 2014 13:40:29 +0000 (09:40 -0400)
committerGil Moskowitz <gmoskowitz@xtuple.com>
Wed, 17 Sep 2014 13:40:29 +0000 (09:40 -0400)
lib/orm/source/xt/javascript/data.sql

index a93b75a..ada5e1b 100644 (file)
@@ -2431,7 +2431,7 @@ select xt.install_js('XT','Data','xtuple', $$
                  "from pg_stat_activity " +
                  "where datname=current_database() " +
                  " and usename=$1 " +
-                 " and procpid=$2;".replace("{pidcol}", pidcol),
+                 " and {pidcol}=$2;",
         query,
         selectSql = "select * " +
                     "from xt.lock " +
@@ -2439,6 +2439,8 @@ select xt.install_js('XT','Data','xtuple', $$
                     " and lock_record_id = $2;",
         username = XT.username;
 
+      pidSql = pidSql.replace(/{pidcol}/g, pidcol);
+
       /* If passed a table name, look up the oid. */
       oid = typeof table === "string" ? this.getTableOid(table) : table;