Merge pull request #348 from arr2036/zero_length_exp
authorAlan DeKok <aland@freeradius.org>
Fri, 5 Jul 2013 16:48:46 +0000 (09:48 -0700)
committerAlan DeKok <aland@freeradius.org>
Fri, 5 Jul 2013 16:48:46 +0000 (09:48 -0700)
Don't generate errors on zero length expansions

raddb/README.rst
raddb/mods-available/sql
src/modules/rlm_sql/drivers/rlm_sql_unixodbc/rlm_sql_unixodbc.c

index fdfc5f6..66e694e 100644 (file)
@@ -138,6 +138,19 @@ And all of the SQL queries will be logged to that file.  The
 connection pool        will still need to be configured for the NULL SQL
 driver, but the defaults will work.
 
+rlm_sql_sybase
+--------------
+
+The ``rlm_sql_sybase`` module has been renamed to ``rlm_sql_freetds``
+and the old ``rlm_sql_freetds`` module has been removed.
+
+``rlm_sql_sybase`` used the newer ct-lib API, and ``rlm_sql_freetds``
+used and older API and was incomplete. 
+
+The new ``rlm_sql_freetds`` module now also supports database 
+selection on connection startup so ``use`` statements no longer 
+have to be included in queries.
+
 sql/dialup.conf
 ---------------
 
index 8fcce34..16d2cf9 100644 (file)
@@ -143,5 +143,5 @@ sql {
        client_table = "nas"
 
        # Read database-specific queries
-       $INCLUDE ${modconfdir}/${.:name}/${dialect}/queries.conf
+       $INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
 }
index 8d6fb48..0319f24 100644 (file)
@@ -49,7 +49,7 @@ static int sql_socket_destructor(void *c)
 {
        rlm_sql_unixodbc_conn_t *conn = c;
        
-       DEBUG2("rlm_sql_sybase: Socket destructor called, closing socket");
+       DEBUG2("rlm_sql_unixodbc: Socket destructor called, closing socket");
 
        if (conn->statement) {
                SQLFreeStmt(conn->statement, SQL_DROP);
@@ -119,7 +119,10 @@ static sql_rcode_t sql_socket_init(rlm_sql_handle_t *handle, rlm_sql_config_t *c
        if (sql_state(err_handle, handle, config)) {
                ERROR("rlm_sql_unixodbc: Connection failed\n");
                SQLFreeHandle(SQL_HANDLE_DBC, conn->dbc);
+               conn->dbc = NULL;
                SQLFreeHandle(SQL_HANDLE_ENV, conn->env);
+               conn->env = NULL;
+               
                return -1;
        }