| 71 | } |
| 72 | |
| 73 | static bool tbl_create(const char* dbaddr, const char* dbname, |
| 74 | const char* dbuser, const char* dbpass) |
| 75 | { |
| 76 | acl::db_mysql db(dbaddr, dbname, dbuser, dbpass); |
| 77 | if (db.open() == false) |
| 78 | { |
| 79 | printf("open %s@mysql error, dbuser: %s, dbpass: %s\r\n", |
| 80 | dbaddr, dbuser, dbpass); |
| 81 | return false; |
| 82 | } |
| 83 | |
| 84 | printf("mysqlclient lib's version: %ld, info: %s\r\n", |
| 85 | db.mysql_libversion(), db.mysql_client_info()); |
| 86 | |
| 87 | if (db.tbl_exists("group_tbl")) |
| 88 | { |
| 89 | printf("table exist\r\n"); |
| 90 | return (true); |
| 91 | } |
| 92 | else if (db.sql_update(CREATE_TBL) == false) |
| 93 | { |
| 94 | printf("sql error\r\n"); |
| 95 | return (false); |
| 96 | } |
| 97 | else |
| 98 | { |
| 99 | printf("create table ok\r\n"); |
| 100 | return (true); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | // ���ӱ����� |
| 105 | static bool tbl_insert(acl::db_handle& db, int n) |
no test coverage detected
searching dependent graphs…