mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.3.4.1'
This commit is contained in:
@@ -37,7 +37,7 @@ public class Fsd_bin_tbl implements Rls_able {
|
||||
stmt_insert = Db_stmt_.Rls(stmt_insert);
|
||||
stmt_select = Db_stmt_.Rls(stmt_select);
|
||||
}
|
||||
public void Create_tbl() {conn.Ddl_create_tbl(Dbmeta_tbl_itm.New(tbl_name, flds));}
|
||||
public void Create_tbl() {conn.Meta_tbl_create(Dbmeta_tbl_itm.New(tbl_name, flds));}
|
||||
public void Insert_bgn() {conn.Txn_bgn("fsdb_bin__insert"); stmt_insert = conn.Stmt_insert(tbl_name, flds);}
|
||||
public void Insert_commit() {conn.Txn_sav();}
|
||||
public void Insert_end() {conn.Txn_end(); stmt_insert = Db_stmt_.Rls(stmt_insert);}
|
||||
|
||||
@@ -21,7 +21,6 @@ public class Fsd_dir_itm {
|
||||
public int Dir_id() {return dir_id;} private final int dir_id;
|
||||
public int Owner() {return owner;} private final int owner;
|
||||
public byte[] Name() {return name;} private final byte[] name;
|
||||
|
||||
public static final int Owner_root = 0;
|
||||
public static final Fsd_dir_itm Null = null;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class Fsd_dir_tbl implements Rls_able {
|
||||
stmt_select_by_name = Db_stmt_.Rls(stmt_select_by_name);
|
||||
}
|
||||
public void Create_tbl() {
|
||||
conn.Ddl_create_tbl
|
||||
conn.Meta_tbl_create
|
||||
( Dbmeta_tbl_itm.New(tbl_name, flds
|
||||
, Dbmeta_idx_itm.new_normal_by_tbl(tbl_name, "name", fld_name, fld_owner_id, fld_id)));
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class Fsd_fil_tbl implements Rls_able {
|
||||
stmt_select_by_name = Db_stmt_.Rls(stmt_select_by_name);
|
||||
}
|
||||
public void Create_tbl() {
|
||||
conn.Ddl_create_tbl(Dbmeta_tbl_itm.New(tbl_name, flds
|
||||
conn.Meta_tbl_create(Dbmeta_tbl_itm.New(tbl_name, flds
|
||||
, Dbmeta_idx_itm.new_unique_by_name(tbl_name, idx_owner, fld_owner_id, fld_name, fld_id)
|
||||
));
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ public class Fsd_thm_itm {
|
||||
public int Req_w() {return req_w;} private int req_w;
|
||||
public double Req_time() {return req_time;} private double req_time;
|
||||
public int Req_page() {return req_page;} private int req_page;
|
||||
|
||||
public void Init_by_req(int w, double time, int page) {this.w = w; this.time = time; this.page = page;}
|
||||
public void Init_by_match(Fsd_thm_itm comp) {
|
||||
this.req_w = w; this.req_time = time; this.req_page = page;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class Fsd_thm_tbl implements Rls_able {
|
||||
stmt_select_by_fil_near = Db_stmt_.Rls(stmt_select_by_fil_near);
|
||||
}
|
||||
public void Create_tbl() {
|
||||
conn.Ddl_create_tbl(Dbmeta_tbl_itm.New(tbl_name, flds
|
||||
conn.Meta_tbl_create(Dbmeta_tbl_itm.New(tbl_name, flds
|
||||
, Dbmeta_idx_itm.new_unique_by_tbl(tbl_name, "owner", fld_owner_id, fld_id, fld_w, fld_time, fld_page)
|
||||
));
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class Fsm_atr_tbl {
|
||||
this.fld_uid = flds.Add_int_pkey (fld_prefix + "uid");
|
||||
this.fld_url = flds.Add_str (fld_prefix + "url", 255);
|
||||
}
|
||||
public void Create_tbl() {conn.Ddl_create_tbl(Dbmeta_tbl_itm.New(tbl_name, flds));}
|
||||
public void Create_tbl() {conn.Meta_tbl_create(Dbmeta_tbl_itm.New(tbl_name, flds));}
|
||||
public Fsm_atr_fil Select_1st_or_fail(Fsm_mnt_itm mnt_itm, Fsdb_db_mgr core_mgr, int mnt_id, boolean schema_thm_page) {
|
||||
Db_rdr rdr = conn.Stmt_select(tbl_name, flds, Dbmeta_fld_itm.Str_ary_empty).Exec_select__rls_auto();
|
||||
boolean schema_is_1 = core_mgr.File__schema_is_1();
|
||||
@@ -47,7 +47,7 @@ public class Fsm_atr_tbl {
|
||||
}
|
||||
}
|
||||
finally {rdr.Rls();}
|
||||
throw Err_.new_wo_type("missing atr db", "conn", conn.Conn_info().Xto_api());
|
||||
throw Err_.new_wo_type("missing atr db", "conn", conn.Conn_info().Db_api());
|
||||
}
|
||||
public void Insert(int id, String url_rel) {
|
||||
conn.Stmt_insert(tbl_name, flds).Val_int(fld_uid, id).Val_str(fld_url, url_rel).Exec_insert();
|
||||
|
||||
@@ -37,7 +37,7 @@ public class Fsm_bin_tbl {
|
||||
fld_bin_max = Dbmeta_fld_itm.Key_null;
|
||||
}
|
||||
}
|
||||
public void Create_tbl() {conn.Ddl_create_tbl(Dbmeta_tbl_itm.New(tbl_name, flds));}
|
||||
public void Create_tbl() {conn.Meta_tbl_create(Dbmeta_tbl_itm.New(tbl_name, flds));}
|
||||
public void Insert(int id, String url_rel) {
|
||||
conn.Stmt_insert(tbl_name, flds).Crt_int(fld_uid, id).Val_str(fld_url, url_rel).Val_long(fld_bin_len, 0).Val_long(fld_bin_max, 0).Exec_insert();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public class Fsm_cfg_mgr {
|
||||
}
|
||||
public void Ctor_by_load() {
|
||||
Db_cfg_hash hash = Grps_get_or_load(Grp_core);
|
||||
this.next_id = hash.Get_by(Key_next_id).To_int_or(-1); if (next_id == -1) throw Err_.new_wo_type("next_id not found in cfg", "url", tbl.Conn().Conn_info().Xto_api());
|
||||
this.next_id = hash.Get_by(Key_next_id).To_int_or(-1); if (next_id == -1) throw Err_.new_wo_type("next_id not found in cfg", "url", tbl.Conn().Conn_info().Db_api());
|
||||
this.schema_thm_page = hash.Get_by(Key_schema_thm_page).To_yn_or_n();
|
||||
this.patch__next_id = hash.Get_by(Key_patch__next_id).To_yn_or_n();
|
||||
this.patch__page_gt_1 = hash.Get_by(Key_patch__page_gt_1).To_yn_or_n();
|
||||
|
||||
@@ -65,8 +65,8 @@ class Fsm_mnt_itm_ {
|
||||
Fsm_cfg_mgr cfg_mgr = abc_mgr.Cfg_mgr();
|
||||
int last_id = -1;
|
||||
Fsm_atr_fil atr_fil = atr_mgr.Db__core();
|
||||
int max_fil_id = Db_conn_.Select_fld0_as_int_or(atr_fil.Conn(), "SELECT Max(fil_id) AS MaxId FROM fsdb_fil;", -1);
|
||||
int max_thm_id = Db_conn_.Select_fld0_as_int_or(atr_fil.Conn(), "SELECT Max(thm_id) AS MaxId FROM fsdb_xtn_thm;", -1);
|
||||
int max_fil_id = atr_fil.Conn().Exec_select_as_int("SELECT Max(fil_id) AS MaxId FROM fsdb_fil;", -1);
|
||||
int max_thm_id = atr_fil.Conn().Exec_select_as_int("SELECT Max(thm_id) AS MaxId FROM fsdb_xtn_thm;", -1);
|
||||
last_id = max_fil_id > max_thm_id ? max_fil_id : max_thm_id;
|
||||
cfg_mgr.Patch_next_id_exec(last_id);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Fsm_mnt_tbl implements Rls_able {
|
||||
}
|
||||
public void Create_tbl() {
|
||||
Dbmeta_tbl_itm meta = Dbmeta_tbl_itm.New(tbl_name, flds);
|
||||
conn.Ddl_create_tbl(meta);
|
||||
conn.Meta_tbl_create(meta);
|
||||
this.Insert(Fsm_mnt_mgr.Mnt_idx_main, Mnt_name_main, Mnt_name_main);
|
||||
this.Insert(Fsm_mnt_mgr.Mnt_idx_user, Mnt_name_user, Mnt_name_user);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user