From 8e74a29f079f421412c882ac182fbd263ecad433 Mon Sep 17 00:00:00 2001 From: bookug Date: Sat, 25 Mar 2017 20:08:23 +0800 Subject: [PATCH] fix bug in DEBUG macros; change int type to unsigned type but Query/* may not be fully changed --- Database/Database.cpp | 19 +- Database/Join.cpp | 2 + Main/gadd.cpp | 4 +- Main/gbuild.cpp | 4 +- Main/gclient.cpp | 6 +- Main/gconsole.cpp | 4 +- Main/gquery.cpp | 4 +- Main/gserver.cpp | 4 +- Main/gsub.cpp | 4 +- Query/GeneralEvaluation.cpp | 3 +- Query/GeneralEvaluation.h | 2 +- Util/Util.h | 5 +- data/bbug.nt | 2000 +++++++++++++++++++++++++++++++++++ data/bbug0.sql | 5 + data/bbug0d.sql | 1 + data/bbug1.sql | 1 + data/bbug2.sql | 1 + data/bbug3.sql | 1 + data/bbug4.sql | 5 + data/bbug5.sql | 1 + data/bbug6.sql | 1 + data/error.sql | 1 + data/exist.sql | 1 + data/fault.sql | 1 + data/para1.sql | 4 - data/para2.sql | 5 - 26 files changed, 2055 insertions(+), 34 deletions(-) create mode 100644 data/bbug.nt create mode 100644 data/bbug0.sql create mode 100644 data/bbug0d.sql create mode 100644 data/bbug1.sql create mode 100644 data/bbug2.sql create mode 100644 data/bbug3.sql create mode 100644 data/bbug4.sql create mode 100644 data/bbug5.sql create mode 100644 data/bbug6.sql create mode 100644 data/error.sql create mode 100644 data/exist.sql create mode 100644 data/fault.sql delete mode 100644 data/para1.sql delete mode 100644 data/para2.sql diff --git a/Database/Database.cpp b/Database/Database.cpp index 41c1904..0ac5e41 100644 --- a/Database/Database.cpp +++ b/Database/Database.cpp @@ -289,7 +289,7 @@ Database::writeIDinfo() } //ID alloc garbage error(LITERAL_FIRST_ID or double) add base for literal -int +TYPE_ENTITY_LITERAL_ID Database::allocEntityID() { //int t; @@ -301,7 +301,8 @@ Database::allocEntityID() if (this->limitID_entity >= Util::LITERAL_FIRST_ID) { cout << "fail to alloc id for entity" << endl; - return -1; + //return -1; + return INVALID; } } else @@ -332,7 +333,7 @@ Database::freeEntityID(TYPE_ENTITY_LITERAL_ID _id) this->entity_num--; } -int +TYPE_ENTITY_LITERAL_ID Database::allocLiteralID() { //int t; @@ -344,7 +345,8 @@ Database::allocLiteralID() if (this->limitID_literal >= Util::LITERAL_FIRST_ID) { cout << "fail to alloc id for literal" << endl; - return -1; + //return -1; + return INVALID; } } else @@ -377,7 +379,7 @@ Database::freeLiteralID(TYPE_ENTITY_LITERAL_ID _id) this->literal_num--; } -int +TYPE_PREDICATE_ID Database::allocPredicateID() { //int t; @@ -389,6 +391,7 @@ Database::allocPredicateID() if (this->limitID_predicate >= Util::LITERAL_FIRST_ID) { cout << "fail to alloc id for predicate" << endl; + //WARN:if pid is changed to unsigned type, this must be changed return -1; } } @@ -1361,6 +1364,7 @@ Database::sub2id_pre2id_obj2id_RDFintoSignature(const string _rdf_file, TYPE_ENT cout << "finish initial sub2id_pre2id_obj2id" << endl; //BETTER?:close the stdio buffer sync?? + ifstream _fin(_rdf_file.c_str()); if (!_fin) { @@ -1420,8 +1424,9 @@ Database::sub2id_pre2id_obj2id_RDFintoSignature(const string _rdf_file, TYPE_ENT //Process the Triple one by one for (int i = 0; i < parse_triple_num; i++) { - //TODO+BETTER: assume that no duplicate triples in RDF for building - //should judge first?? + //BETTER: assume that no duplicate triples in RDF for building + //should judge first? using exist_triple() + //or sub triples_num in build_subID2values(judge if two neighbor triples are same) this->triples_num++; //if the _id_tuples exceeds, double the space diff --git a/Database/Join.cpp b/Database/Join.cpp index 06f76d3..31471fb 100644 --- a/Database/Join.cpp +++ b/Database/Join.cpp @@ -1815,6 +1815,8 @@ Join::preFilter(int _var) continue; } + //TODO+BETTER: is any pre really used? do we need to losen the restrictions? + //size:m "22". + "20". + "17ec". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "zzmw". + "开放性". + . + . + . + . + . + . + "22". + "20". + "kzlv". + "开放性". + . + . + . + . + . + . + "22". + "20". + "61sr". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "xsmp". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "sr9g". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "0p2d". + "高可用". + . + . + . + . + . + . + "22". + "20". + "toex". + "高可用". + . + . + . + . + . + . + "22". + "20". + "gvl4". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "li68". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "2cr5". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "17fq". + "高可用". + . + . + . + . + . + . + "22". + "20". + "teu2". + "开放性". + . + . + . + . + . + . + "22". + "20". + "zur9". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "fks7". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "rtm8". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "trl0". + "高可用". + . + . + . + . + . + . + "22". + "20". + "j435". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "3tks". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "p58f". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "y7w7". + "高可用". + . + . + . + . + . + . + "22". + "20". + "axim". + "高可用". + . + . + . + . + . + . + "22". + "20". + "s6uu". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "tcun". + "高可用". + . + . + . + . + . + . + "22". + "20". + "aivr". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "8cdg". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "y72q". + "开放性". + . + . + . + . + . + . + "22". + "20". + "c8vk". + "高可用". + . + . + . + . + . + . + "22". + "20". + "ei2u". + "开放性". + . + . + . + . + . + . + "22". + "20". + "fuz9". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "ykzq". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "cog5". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "77qr". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "2tg0". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "45mt". + "开放性". + . + . + . + . + . + . + "22". + "20". + "bipk". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "m8be". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "ho09". + "高可用". + . + . + . + . + . + . + "22". + "20". + "qisv". + "开放性". + . + . + . + . + . + . + "22". + "20". + "3fpo". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "5vyz". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "9vij". + "高可用". + . + . + . + . + . + . + "22". + "20". + "nkx4". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "zkkx". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "i9r9". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "6uhu". + "开放性". + . + . + . + . + . + . + "22". + "20". + "ah9b". + "高可用". + . + . + . + . + . + . + "22". + "20". + "a97c". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "twu6". + "开放性". + . + . + . + . + . + . + "22". + "20". + "dsxf". + "开放性". + . + . + . + . + . + . + "22". + "20". + "kls8". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "nnef". + "开放性". + . + . + . + . + . + . + "22". + "20". + "ggxu". + "开放性". + . + . + . + . + . + . + "22". + "20". + "ogmz". + "开放性". + . + . + . + . + . + . + "22". + "20". + "qars". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "prs5". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "blxs". + "开放性". + . + . + . + . + . + . + "22". + "20". + "8fjv". + "高可用". + . + . + . + . + . + . + "22". + "20". + "zz2e". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "5jxu". + "开放性". + . + . + . + . + . + . + "22". + "20". + "p9w0". + "开放性". + . + . + . + . + . + . + "22". + "20". + "mfix". + "开放性". + . + . + . + . + . + . + "22". + "20". + "l273". + "高可用". + . + . + . + . + . + . + "22". + "20". + "ntf4". + "开放性". + . + . + . + . + . + . + "22". + "20". + "vqm7". + "高可用". + . + . + . + . + . + . + "22". + "20". + "2gd1". + "高可用". + . + . + . + . + . + . + "22". + "20". + "t61a". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "nbl8". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "oko4". + "高可用". + . + . + . + . + . + . + "22". + "20". + "y2qq". + "高可用". + . + . + . + . + . + . + "22". + "20". + "0a45". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "qh7p". + "开放性". + . + . + . + . + . + . + "22". + "20". + "osau". + "开放性". + . + . + . + . + . + . + "22". + "20". + "1d71". + "开放性". + . + . + . + . + . + . + "22". + "20". + "w6hh". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "xwsv". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "f4dk". + "开放性". + . + . + . + . + . + . + "22". + "20". + "ewk4". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "oe1p". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "eny4". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "ao9y". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "zd8n". + "开放性". + . + . + . + . + . + . + "22". + "20". + "6qt4". + "开放性". + . + . + . + . + . + . + "22". + "20". + "vwlg". + "高可用". + . + . + . + . + . + . + "22". + "20". + "jd50". + "高可用". + . + . + . + . + . + . + "22". + "20". + "6ju4". + "开放性". + . + . + . + . + . + . + "22". + "20". + "fq95". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "wlja". + "开放性". + . + . + . + . + . + . + "22". + "20". + "4g0a". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "419e". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "elu8". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "fdkp". + "开放性". + . + . + . + . + . + . + "22". + "20". + "z5ga". + "扩展性". + . + . + . + . + . + . + "22". + "20". + "2iey". + "高可用". + . + . + . + . + . + . + "22". + "20". + "lhz5". + "开放性". + . + . + . + . + . + . + "22". + "20". + "lrey". + "高可用". + . + . + . + . + . + . + "22". + "20". + "vklx". + "开放性". + . + . + . + . + . + . + "22". + "20". + "gg7c". + "稳定性". + . + . + . + . + . + . + "22". + "20". + "2npw". + "高可用". + . + . + . + . + . + . + "22". + "20". + "ote6". + "扩展性". + . + . + . + . + . + . + "11". + "20". + "茜芳冰". + "跳高". + . + . + . + . + . + . + "11". + "20". + "梅晶莎". + "绘画". + . + . + . + . + . + . + "11". + "20". + "羽婵淑". + "绘画". + . + . + . + . + . + . + "11". + "20". + "莉凡育". + "电影". + . + . + . + . + . + . + "11". + "20". + "桂姣蓉". + "跳高". + . + . + . + . + . + . + "11". + "20". + "璐馨 ". + "绘画". + . + . + . + . + . + . + "11". + "20". + "雅丽岚". + "绘画". + . + . + . + . + . + . + "11". + "20". + "娜滢琴". + "绘画". + . + . + . + . + . + . + "11". + "20". + "姣芬佳". + "电影". + . + . + . + . + . + . + "11". + "20". + "瑾慧筠". + "跳高". + . + . + . + . + . + . + "11". + "20". + "英惠仪". + "电影". + . + . + . + . + . + . + "11". + "20". + "婵晓雁". + "绘画". + . + . + . + . + . + . + "11". + "20". + "翠馥淑". + "电影". + . + . + . + . + . + . + "11". + "20". + "锦聪娟". + "电影". + . + . + . + . + . + . + "11". + "20". + "洁芝蕊". + "音乐". + . + . + . + . + . + . + "11". + "20". + "毓珊黛". + "跳高". + . + . + . + . + . + . + "11". + "20". + "欢毓贞". + "电影". + . + . + . + . + . + . + "11". + "20". + "苑梦欢". + "电影". + . + . + . + . + . + . + "11". + "20". + "桂青悦". + "音乐". + . + . + . + . + . + . + "11". + "20". + "希琼琦". + "跳高". + . + . + . + . + . + . + "11". + "20". + "珍瑾凡". + "跳高". + . + . + . + . + . + . + "11". + "20". + "秋英亚". + "音乐". + . + . + . + . + . + . + "11". + "20". + "悦羽欢". + "电影". + . + . + . + . + . + . + "11". + "20". + "雁飘红". + "跳高". + . + . + . + . + . + . + "11". + "20". + "娣宁怡". + "跳高". + . + . + . + . + . + . + "11". + "20". + "冰君君". + "电影". + . + . + . + . + . + . + "11". + "20". + " 霞妍". + "绘画". + . + . + . + . + . + . + "11". + "20". + "晓翠纯". + "音乐". + . + . + . + . + . + . + "11". + "20". + "羽香环". + "电影". + . + . + . + . + . + . + "11". + "20". + "娥娟聪". + "绘画". + . + . + . + . + . + . + "11". + "20". + "苑 珊". + "跳高". + . + . + . + . + . + . + "11". + "20". + "嘉芬毓". + "电影". + . + . + . + . + . + . + "11". + "20". + "希瑶融". + "音乐". + . + . + . + . + . + . + "11". + "20". + "琼蓓爱". + "绘画". + . + . + . + . + . + . + "11". + "20". + "婷婕凝". + "电影". + . + . + . + . + . + . + "11". + "20". + "影娟 ". + "音乐". + . + . + . + . + . + . + "11". + "20". + "娴娣瑶". + "绘画". + . + . + . + . + . + . + "11". + "20". + "妍静青". + "电影". + . + . + . + . + . + . + "11". + "20". + "叶芝眉". + "音乐". + . + . + . + . + . + . + "11". + "20". + "妹月菁". + "音乐". + . + . + . + . + . + . + "11". + "20". + "丽君滢". + "电影". + . + . + . + . + . + . + "11". + "20". + "霞娅雁". + "跳高". + . + . + . + . + . + . + "11". + "20". + "荣莲昭". + "音乐". + . + . + . + . + . + . + "11". + "20". + "琦瑾娴". + "音乐". + . + . + . + . + . + . + "11". + "20". + "美融毓". + "电影". + . + . + . + . + . + . + "11". + "20". + "珊蓉馥". + "音乐". + . + . + . + . + . + . + "11". + "20". + "英蕊彩". + "绘画". + . + . + . + . + . + . + "11". + "20". + "荷舒琬". + "电影". + . + . + . + . + . + . + "11". + "20". + "悦雁兰". + "跳高". + . + . + . + . + . + . + "11". + "20". + "月巧茜". + "绘画". + . + . + . + . + . + . + "11". + "20". + "姣纯昭". + "电影". + . + . + . + . + . + . + "11". + "20". + "梦蕊融". + "音乐". + . + . + . + . + . + . + "11". + "20". + "兰霞伊". + "音乐". + . + . + . + . + . + . + "11". + "20". + " 玲春". + "电影". + . + . + . + . + . + . + "11". + "20". + "薇冰妹". + "电影". + . + . + . + . + . + . + "11". + "20". + "舒婵霞". + "跳高". + . + . + . + . + . + . + "11". + "20". + "荷娜珊". + "跳高". + . + . + . + . + . + . + "11". + "20". + "茜君纨". + "电影". + . + . + . + . + . + . + "11". + "20". + "竹娟雪". + "绘画". + . + . + . + . + . + . + "11". + "20". + "琰珍娣". + "跳高". + . + . + . + . + . + . + "11". + "20". + "宁红璐". + "音乐". + . + . + . + . + . + . + "11". + "20". + "柔倩桂". + "跳高". + . + . + . + . + . + . + "11". + "20". + " 纯瑗". + "音乐". + . + . + . + . + . + . + "11". + "20". + "琦真春". + "电影". + . + . + . + . + . + . + "11". + "20". + "纯澜筠". + "跳高". + . + . + . + . + . + . + "11". + "20". + "茜洁莎". + "电影". + . + . + . + . + . + . + "11". + "20". + "柔惠姬". + "绘画". + . + . + . + . + . + . + "11". + "20". + "霄蕊纨". + "跳高". + . + . + . + . + . + . + "11". + "20". + "丽姬卿". + "绘画". + . + . + . + . + . + . + "11". + "20". + " 娅叶". + "音乐". + . + . + . + . + . + . + "11". + "20". + "露莉琴". + "音乐". + . + . + . + . + . + . + "11". + "20". + "霄淑眉". + "音乐". + . + . + . + . + . + . + "11". + "20". + "巧霞芝". + "跳高". + . + . + . + . + . + . + "11". + "20". + "洁薇叶". + "音乐". + . + . + . + . + . + . + "11". + "20". + "锦丽青". + "跳高". + . + . + . + . + . + . + "11". + "20". + "舒华环". + "电影". + . + . + . + . + . + . + "11". + "20". + "真锦艺". + "电影". + . + . + . + . + . + . + "11". + "20". + "艳婵凤". + "音乐". + . + . + . + . + . + . + "11". + "20". + "蕊贞莺". + "音乐". + . + . + . + . + . + . + "11". + "20". + "馥舒菁". + "电影". + . + . + . + . + . + . + "11". + "20". + "莎玉春". + "跳高". + . + . + . + . + . + . + "11". + "20". + "贞荷怡". + "跳高". + . + . + . + . + . + . + "11". + "20". + "仪可梦". + "绘画". + . + . + . + . + . + . + "11". + "20". + "育媛纯". + "音乐". + . + . + . + . + . + . + "11". + "20". + "叶颖薇". + "绘画". + . + . + . + . + . + . + "11". + "20". + "晶娅爽". + "音乐". + . + . + . + . + . + . + "11". + "20". + "卿露荔". + "跳高". + . + . + . + . + . + . + "11". + "20". + "玲枫锦". + "绘画". + . + . + . + . + . + . + "11". + "20". + "枫艳荷". + "跳高". + . + . + . + . + . + . + "11". + "20". + "蓉娟蓉". + "音乐". + . + . + . + . + . + . + "11". + "20". + "月玉蓉". + "跳高". + . + . + . + . + . + . + "11". + "20". + "仪寒娜". + "绘画". + . + . + . + . + . + . + "11". + "20". + "飘婉瑶". + "音乐". + . + . + . + . + . + . + "11". + "20". + "兰妍巧". + "音乐". + . + . + . + . + . + . + "11". + "20". + "叶秀华". + "绘画". + . + . + . + . + . + . + "11". + "20". + "琬 珠". + "绘画". + . + . + . + . + . + . + "11". + "20". + "月璧瑶". + "绘画". + . + . + . + . + . + . + "11". + "20". + "姣荣枫". + "电影". + . + . + . + . + . + . + "11". + "20". + "荣兰昭". + "电影". + . + . + . + . + . + . + "11". + "20". + "妍艺茗". + "音乐". + . + . + . + . + . + . diff --git a/data/bbug0.sql b/data/bbug0.sql new file mode 100644 index 0000000..d89b0e3 --- /dev/null +++ b/data/bbug0.sql @@ -0,0 +1,5 @@ +INSERT DATA +{ + . + . +} diff --git a/data/bbug0d.sql b/data/bbug0d.sql new file mode 100644 index 0000000..b7dc5d5 --- /dev/null +++ b/data/bbug0d.sql @@ -0,0 +1 @@ +DELETE DATA { . } diff --git a/data/bbug1.sql b/data/bbug1.sql new file mode 100644 index 0000000..bee32b2 --- /dev/null +++ b/data/bbug1.sql @@ -0,0 +1 @@ +select ?subject ?predict ?object WHERE { ?subject ?object; ?predict ?object . } diff --git a/data/bbug2.sql b/data/bbug2.sql new file mode 100644 index 0000000..0201729 --- /dev/null +++ b/data/bbug2.sql @@ -0,0 +1 @@ +DELETE WHERE { ?predict ?object . } diff --git a/data/bbug3.sql b/data/bbug3.sql new file mode 100644 index 0000000..89665fa --- /dev/null +++ b/data/bbug3.sql @@ -0,0 +1 @@ +select ?predict where { ?predict .} diff --git a/data/bbug4.sql b/data/bbug4.sql new file mode 100644 index 0000000..1138aea --- /dev/null +++ b/data/bbug4.sql @@ -0,0 +1,5 @@ +select ?subject ?predict ?object where +{ + ?object. + ?subject ?predict ?object. +} diff --git a/data/bbug5.sql b/data/bbug5.sql new file mode 100644 index 0000000..03312cd --- /dev/null +++ b/data/bbug5.sql @@ -0,0 +1 @@ +select ?subject ?predict ?object where {?subject ; ?predict ?object . } diff --git a/data/bbug6.sql b/data/bbug6.sql new file mode 100644 index 0000000..192c12c --- /dev/null +++ b/data/bbug6.sql @@ -0,0 +1 @@ +DELETE WHERE { ?subject ?objcet. } diff --git a/data/error.sql b/data/error.sql new file mode 100644 index 0000000..53ca630 --- /dev/null +++ b/data/error.sql @@ -0,0 +1 @@ +select ?a WHERE { . } diff --git a/data/exist.sql b/data/exist.sql new file mode 100644 index 0000000..4567850 --- /dev/null +++ b/data/exist.sql @@ -0,0 +1 @@ +select ?s where { "22". } diff --git a/data/fault.sql b/data/fault.sql new file mode 100644 index 0000000..53ca630 --- /dev/null +++ b/data/fault.sql @@ -0,0 +1 @@ +select ?a WHERE { . } diff --git a/data/para1.sql b/data/para1.sql deleted file mode 100644 index bcdec9b..0000000 --- a/data/para1.sql +++ /dev/null @@ -1,4 +0,0 @@ -select ?p where -{ - ?p . -} diff --git a/data/para2.sql b/data/para2.sql deleted file mode 100644 index e04d0c0..0000000 --- a/data/para2.sql +++ /dev/null @@ -1,5 +0,0 @@ -select ?s ?o where -{ -?s ?o . -?s ?o . -}