Loading meson.build +1 −1 Original line number Diff line number Diff line # -*- mode: conf -*- project('zero-pinyin-service', ['c', 'cpp'], version: '0.3.0', version: '0.3.1', license: 'GPL', default_options: [ 'warning_level=2', Loading test-sql.sh +1 −1 Original line number Diff line number Diff line Loading @@ -2,5 +2,5 @@ sqlite3 -echo \ -cmd '.headers on' \ -cmd '.prompt "zerodb> " " ...> "' \ -cmd 'attach "/usr/share/pyzy/db/open-phrase.db" as "maindb"; attach "/home/sylecn/.cache/ibus/pinyin/user-1.0.db" as "userdb";' \ -cmd 'attach "/home/sylecn/.cache/ibus/pinyin/main.db" as "maindb"; attach "/home/sylecn/.cache/ibus/pinyin/user-1.0.db" as "userdb";' \ ':memory:' zero-pinyin-service.c +2 −2 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ build_sql_for_n_pinyin (GList* pylist, /* always keep one space after current term */ GString* sql = NULL; gchar* where_clause = NULL; sql = g_string_new (NULL); sql = g_string_new ("SELECT MAX(user_freq), phrase, MAX(freq) FROM ("); g_string_append_printf ( sql, "SELECT 0 AS user_freq, phrase, freq FROM " "maindb.py_phrase_%u WHERE ", n - 1); Loading @@ -101,7 +101,7 @@ build_sql_for_n_pinyin (GList* pylist, sql, "SELECT user_freq, phrase, freq FROM " "userdb.py_phrase_%u WHERE ", n - 1); sql = g_string_append (sql, where_clause); sql = g_string_append (sql, "GROUP BY phrase ORDER BY user_freq DESC, freq DESC "); sql = g_string_append (sql, ") GROUP BY phrase ORDER BY user_freq DESC, freq DESC "); g_string_append_printf (sql, "LIMIT %u;", limit); char* result = sql->str; g_free (where_clause); Loading Loading
meson.build +1 −1 Original line number Diff line number Diff line # -*- mode: conf -*- project('zero-pinyin-service', ['c', 'cpp'], version: '0.3.0', version: '0.3.1', license: 'GPL', default_options: [ 'warning_level=2', Loading
test-sql.sh +1 −1 Original line number Diff line number Diff line Loading @@ -2,5 +2,5 @@ sqlite3 -echo \ -cmd '.headers on' \ -cmd '.prompt "zerodb> " " ...> "' \ -cmd 'attach "/usr/share/pyzy/db/open-phrase.db" as "maindb"; attach "/home/sylecn/.cache/ibus/pinyin/user-1.0.db" as "userdb";' \ -cmd 'attach "/home/sylecn/.cache/ibus/pinyin/main.db" as "maindb"; attach "/home/sylecn/.cache/ibus/pinyin/user-1.0.db" as "userdb";' \ ':memory:'
zero-pinyin-service.c +2 −2 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ build_sql_for_n_pinyin (GList* pylist, /* always keep one space after current term */ GString* sql = NULL; gchar* where_clause = NULL; sql = g_string_new (NULL); sql = g_string_new ("SELECT MAX(user_freq), phrase, MAX(freq) FROM ("); g_string_append_printf ( sql, "SELECT 0 AS user_freq, phrase, freq FROM " "maindb.py_phrase_%u WHERE ", n - 1); Loading @@ -101,7 +101,7 @@ build_sql_for_n_pinyin (GList* pylist, sql, "SELECT user_freq, phrase, freq FROM " "userdb.py_phrase_%u WHERE ", n - 1); sql = g_string_append (sql, where_clause); sql = g_string_append (sql, "GROUP BY phrase ORDER BY user_freq DESC, freq DESC "); sql = g_string_append (sql, ") GROUP BY phrase ORDER BY user_freq DESC, freq DESC "); g_string_append_printf (sql, "LIMIT %u;", limit); char* result = sql->str; g_free (where_clause); Loading