| 41 | |
| 42 | |
| 43 | int cpl_db_bind(const str* db_url, const str *db_table) |
| 44 | { |
| 45 | if (db_bind_mod(db_url, &cpl_dbf )) { |
| 46 | LM_CRIT("cannot bind to database module! " |
| 47 | "Did you forget to load a database module ?\n"); |
| 48 | return -1; |
| 49 | } |
| 50 | |
| 51 | /* CPL module uses all database functions */ |
| 52 | if (!DB_CAPABILITY(cpl_dbf, DB_CAP_ALL)) { |
| 53 | LM_CRIT("Database modules does not " |
| 54 | "provide all functions needed by cpl_c module\n"); |
| 55 | return -1; |
| 56 | } |
| 57 | |
| 58 | if ( cpl_db_init( db_url, db_table) ) |
| 59 | return -1; |
| 60 | |
| 61 | if(db_check_table_version(&cpl_dbf, db_hdl, db_table, TABLE_VERSION) < 0) { |
| 62 | LM_ERR("error during table version check.\n"); |
| 63 | cpl_db_close(); |
| 64 | return -1; |
| 65 | } |
| 66 | |
| 67 | cpl_db_close(); |
| 68 | return 0; |
| 69 | } |
| 70 | |
| 71 | |
| 72 |
no test coverage detected