| 1999 | } |
| 2000 | |
| 2001 | static int graph_prepare_node_cursor(cbm_store_t *store, const char *project, |
| 2002 | graph_node_cursor_t *cursor) { |
| 2003 | static const char sql[] = |
| 2004 | "SELECT qualified_name,label,replace(coalesce(file_path,''),'\\','/') " |
| 2005 | "FROM nodes WHERE project=?1 " |
| 2006 | "ORDER BY qualified_name COLLATE BINARY,label COLLATE BINARY," |
| 2007 | "replace(coalesce(file_path,''),'\\','/') COLLATE BINARY;"; |
| 2008 | if (sqlite3_prepare_v2(store->db, sql, CBM_NOT_FOUND, &cursor->stmt, NULL) != SQLITE_OK) { |
| 2009 | store_set_error_sqlite(store, "compare node prepare"); |
| 2010 | return CBM_STORE_ERR; |
| 2011 | } |
| 2012 | if (graph_compare_bind_text(cursor->stmt, SKIP_ONE, project) != SQLITE_OK) { |
| 2013 | store_set_error(store, "compare node bind failed"); |
| 2014 | sqlite3_finalize(cursor->stmt); |
| 2015 | cursor->stmt = NULL; |
| 2016 | return CBM_STORE_ERR; |
| 2017 | } |
| 2018 | return graph_node_cursor_step(store, cursor); |
| 2019 | } |
| 2020 | |
| 2021 | static int graph_prepare_edge_cursor(cbm_store_t *store, const char *project, |
| 2022 | graph_edge_cursor_t *cursor) { |
no test coverage detected