snprintf(statement,sizeof(statement),"select ip_range from %s_peer_ip",kind);
snprintf(statement,sizeof(statement),"select ip_range,realm from %s_peer_ip",kind);
intres=mysql_query(myc,statement);
if(res){
staticintwrong_table_reported=0;
if(!wrong_table_reported){
wrong_table_reported=1;
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR,"Error retrieving MySQL DB information; probably, the tables 'allowed_peer_ip' and/or 'denied_peer_ip' have to be upgraded to include the realm column.\n");
}
snprintf(statement,sizeof(statement),"select ip_range,'' from %s_peer_ip",kind);
snprintf(statement,sizeof(statement),"select ip_range from %s_peer_ip",kind);
snprintf(statement,sizeof(statement),"select ip_range,realm from %s_peer_ip",kind);
PGresult*res=PQexec(pqc,statement);
if(res&&(PQresultStatus(res)==PGRES_TUPLES_OK)){
if(!res||(PQresultStatus(res)!=PGRES_TUPLES_OK)){
staticintwrong_table_reported=0;
if(!wrong_table_reported){
wrong_table_reported=1;
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR,"Error retrieving PostgreSQL DB information: %s; probably, the tables 'allowed_peer_ip' and/or 'denied_peer_ip' have to be upgraded to include the realm column.\n",PQerrorMessage(pqc));
}
snprintf(statement,sizeof(statement),"select ip_range,'' from %s_peer_ip",kind);