mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Import: Expand index on temp category table to include cl_type
This commit is contained in:
parent
9e1bbe0235
commit
12459429b4
@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx;
|
||||
import gplx.core.errs.*;
|
||||
public class Err extends RuntimeException {
|
||||
private final boolean is_gplx;
|
||||
private final String trace;
|
||||
private final boolean is_gplx;
|
||||
private final String trace;
|
||||
private Err_msg[] msgs_ary = new Err_msg[8]; private int msgs_len = 8, msgs_idx = 0;
|
||||
public Err(boolean is_gplx, String trace, String type, String msg, Object... args) {
|
||||
this.is_gplx = is_gplx;
|
||||
|
@ -19,6 +19,17 @@ package gplx;
|
||||
import java.lang.*;
|
||||
import gplx.core.strings.*; import gplx.langs.gfs.*; import gplx.core.envs.*;
|
||||
public class String_ implements Gfo_invk {
|
||||
public static int Len(String s) {return s.length();}
|
||||
public static char CharAt(String s, int i) {return s.charAt(i);}
|
||||
public static String new_u8(byte[] v, int bgn, int end) {
|
||||
try {
|
||||
return v == null
|
||||
? null
|
||||
: new String(v, bgn, end - bgn, "UTF-8");
|
||||
}
|
||||
catch (Exception e) {Err_.Noop(e); throw Err_.new_("core", "unsupported encoding", "bgn", bgn, "end", end);}
|
||||
}
|
||||
|
||||
public static final Class<?> Cls_ref_type = String.class;
|
||||
public static final String Cls_val_name = "str" + "ing";
|
||||
public static final int Find_none = -1, Pos_neg1 = -1;
|
||||
@ -35,14 +46,6 @@ public class String_ implements Gfo_invk {
|
||||
catch (Exception e) {throw Err_.new_exc(e, "core", "unsupported encoding");}
|
||||
}
|
||||
public static String new_u8(byte[] v) {return v == null ? null : new_u8(v, 0, v.length);}
|
||||
public static String new_u8(byte[] v, int bgn, int end) {
|
||||
try {
|
||||
return v == null
|
||||
? null
|
||||
: new String(v, bgn, end - bgn, "UTF-8");
|
||||
}
|
||||
catch (Exception e) {Err_.Noop(e); throw Err_.new_("core", "unsupported encoding", "bgn", bgn, "end", end);}
|
||||
}
|
||||
public static String new_u8__by_len(byte[] v, int bgn, int len) {
|
||||
int v_len = v.length;
|
||||
if (bgn + len > v_len) len = v_len - bgn;
|
||||
@ -68,7 +71,6 @@ public class String_ implements Gfo_invk {
|
||||
}
|
||||
public static boolean Len_gt_0(String s) {return s != null && s.length() > 0;}
|
||||
public static boolean Len_eq_0(String s) {return s == null || s.length() == 0;}
|
||||
public static int Len(String s) {return s.length();}
|
||||
public static String Lower(String s) {return s.toLowerCase();}
|
||||
public static String Upper(String s) {return s.toUpperCase();}
|
||||
public static String CaseNormalize(boolean caseSensitive, String s) {return caseSensitive ? s : String_.Lower(s);}
|
||||
@ -76,7 +78,6 @@ public class String_ implements Gfo_invk {
|
||||
public static String Mid(String s, int bgn) {return s.substring(bgn);}
|
||||
public static String Replace(String s, String find, String replace) {return s.replace(find, replace);}
|
||||
public static char[] XtoCharAry(String s) {return s.toCharArray();}
|
||||
public static char CharAt(String s, int i) {return s.charAt(i);}
|
||||
public static int CodePointAt(String s, int i) {return s.codePointAt(i);}
|
||||
public static boolean Has(String s, String find) {return s.indexOf(find) != String_.Find_none;}
|
||||
public static boolean Has_at_bgn(String s, String v) {return s.startsWith(v);}
|
||||
|
@ -32,7 +32,7 @@ public class Xoa_app_ {
|
||||
}
|
||||
}
|
||||
public static final String Name = "xowa";
|
||||
public static final String Version = "3.11.2.7";
|
||||
public static final String Version = "3.11.2.8";
|
||||
public static String Build_date = "2012-12-30 00:00:00";
|
||||
public static String Op_sys_str;
|
||||
public static String User_agent = "";
|
||||
|
@ -101,9 +101,10 @@ class Xob_catlink_wkr {
|
||||
, ", Sum(CASE WHEN tcl.cl_type_id = 1 THEN 1 ELSE 0 END)"
|
||||
, ", CASE WHEN h.cat_id IS NULL THEN 0 ELSE 1 END"
|
||||
, ", -1"
|
||||
, "FROM <temp_db>tmp_cat_link tcl"
|
||||
, " JOIN <page_db>page p ON p.page_namespace = 14 AND tcl.cl_to_ttl = p.page_title"
|
||||
, " LEFT JOIN <temp_db>tmp_cat_hidden h ON h.cat_id = p.page_id"
|
||||
, "FROM <page_db>page p"
|
||||
, " JOIN <temp_db>tmp_cat_link tcl ON tcl.cl_to_ttl = p.page_title"
|
||||
, " LEFT JOIN <temp_db>tmp_cat_hidden h ON h.cat_id = p.page_id"
|
||||
, "WHERE p.page_namespace = 14"
|
||||
, "GROUP BY p.page_id"
|
||||
);
|
||||
attach_mgr.Exec_sql(sql);
|
||||
|
@ -53,7 +53,7 @@ public class Xodb_tmp_cat_link_tbl implements Db_tbl {
|
||||
public void Create_idx__sortkey() {conn.Meta_idx_create(Dbmeta_idx_itm.new_normal_by_tbl(tbl_name, fld_sortkey, fld_sortkey));}
|
||||
public void Create_idx() {
|
||||
conn.Meta_idx_create(Dbmeta_idx_itm.new_normal_by_tbl(tbl_name, fld_from, fld_from));
|
||||
conn.Meta_idx_create(Dbmeta_idx_itm.new_normal_by_tbl(tbl_name, fld_to_ttl, fld_to_ttl));
|
||||
conn.Meta_idx_create(Dbmeta_idx_itm.new_normal_by_tbl(tbl_name, fld_to_ttl + "__" + fld_type_id, fld_to_ttl, fld_type_id));
|
||||
}
|
||||
public void Rls() {
|
||||
stmt_insert = Db_stmt_.Rls(stmt_insert);
|
||||
|
Loading…
Reference in New Issue
Block a user