Skip to content

Commit

Permalink
gcc compilation warning fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lawrinn committed Mar 28, 2023
1 parent b72749f commit 2fb8781
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 18 deletions.
1 change: 1 addition & 0 deletions driver/interface/ResultSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ namespace mariadb
std::vector<odbc::bytes> row;
if (rowData != 0) {
idAsStr= std::to_string(rowData);
row.emplace_back();
BYTES_ASSIGN_STR(row[0], idAsStr);
rows.push_back(row);
}
Expand Down
2 changes: 1 addition & 1 deletion driver/ma_catalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ SQLRETURN MADB_StmtTables(MADB_Stmt *Stmt, char *CatalogName, SQLSMALLINT Catalo
if (TableType && TableTypeLength && strcmp(TableType, SQL_ALL_TABLE_TYPES) != 0)
{
unsigned int i;
char *myTypes[3]= {"TABLE", "VIEW", "SYNONYM"};
const char *myTypes[3]= {"TABLE", "VIEW", "SYNONYM"};
MADB_DYNAPPENDCONST(&StmtStr, " AND TABLE_TYPE IN (''");
for (i= 0; i < 3; i++)
{
Expand Down
3 changes: 2 additions & 1 deletion driver/ma_dsn.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/************************************************************************************
Copyright (C) 2013,2019 MariaDB Corporation AB
Copyright (C) 2013,2023 MariaDB Corporation AB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
Expand Down Expand Up @@ -204,3 +204,4 @@ BOOL MADB_DSN_PossibleConnect (MADB_Dsn *Dsn);
}

#endif /* _ma_dsn_h_ */

4 changes: 2 additions & 2 deletions driver/ma_odbc.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ typedef struct {
char *BaseColumnName;
char *BaseTableName;
char *CatalogName;
char *ColumnName;
const char *ColumnName;
SQLPOINTER DataPtr;
SQLLEN* OctetLengthPtr;
SQLLEN* IndicatorPtr;
Expand All @@ -122,7 +122,7 @@ typedef struct {
char* TableName;
const char* LiteralPrefix;
const char* LiteralSuffix;
char* LocalTypeName;
const char* LocalTypeName;
char* TypeName;
char* InternalBuffer; /* used for internal conversion */
char* DefaultValue;
Expand Down
4 changes: 2 additions & 2 deletions driver/ma_parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const char *MADB_Token(MADB_QUERY *Query, std::size_t Idx)
}


my_bool MADB_CompareToken(MADB_QUERY *Query, unsigned int Idx, char *Compare, size_t Length, unsigned int *Offset)
my_bool MADB_CompareToken(MADB_QUERY *Query, unsigned int Idx, const char *Compare, size_t Length, unsigned int *Offset)
{
const char *TokenString;

Expand All @@ -163,7 +163,7 @@ my_bool MADB_CompareToken(MADB_QUERY *Query, unsigned int Idx, char *Compare, si
}

/* Not used atm, but may be useful */
unsigned int MADB_FindToken(MADB_QUERY *Query, char *Compare)
unsigned int MADB_FindToken(MADB_QUERY *Query, const char *Compare)
{
unsigned int i;
std::size_t TokenCount = Query->Tokens.size();
Expand Down
2 changes: 1 addition & 1 deletion driver/ma_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ int MADB_ParseQuery(MADB_QUERY *Query);
#define QUERY_DOESNT_RETURN_RESULT(query_type) ((query_type) < MADB_QUERY_SELECT)

const char * MADB_ParseCursorName(MADB_QUERY *Query, unsigned int *Offset);
unsigned int MADB_FindToken(MADB_QUERY *Query, char *Compare);
unsigned int MADB_FindToken(MADB_QUERY *Query, const char *Compare);

enum enum_madb_query_type MADB_GetQueryType(const char *Token1, const char *Token2);

Expand Down
2 changes: 1 addition & 1 deletion driver/ma_statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4057,7 +4057,7 @@ SQLRETURN MADB_StmtFetchScroll(MADB_Stmt *Stmt, SQLSMALLINT FetchOrientation,
if (FetchOrientation != SQL_FETCH_NEXT || (RowsProcessed > 1 && Stmt->Options.CursorType != SQL_CURSOR_FORWARD_ONLY) ||
Stmt->Options.CursorType == SQL_CURSOR_DYNAMIC)
{
if (Stmt->Cursor.Next != NULL)
if (Stmt->Cursor.Next != -1)
{
Stmt->rs->absolute(Stmt->Cursor.Next);
ret= SQL_SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion driver/ma_statement.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ SQLRETURN MADB_RealQuery (MADB_Dbc* Dbc, char* StatementText, SQLINTE
#define MADB_POSITIONED_COMMAND(aStmt) ((aStmt)->PositionedCommand && (aStmt)->PositionedCursor)
#define MADB_STMT_HAS_UNIQUE_IDX(aStmt) (aStmt->UniqueIndex != NULL && aStmt->UniqueIndex[0] > 0)
#define MADB_POS_COMM_IDX_FIELD_COUNT(aStmt) (MADB_STMT_HAS_UNIQUE_IDX((aStmt)->PositionedCursor)?(aStmt)->PositionedCursor->UniqueIndex[0]:MADB_STMT_COLUMN_COUNT((aStmt)->PositionedCursor))
#define MADB_STMT_FORGET_NEXT_POS(aStmt) (aStmt)->Cursor.Next= NULL
#define MADB_STMT_FORGET_NEXT_POS(aStmt) (aStmt)->Cursor.Next= -1
#define MADB_STMT_RESET_CURSOR(aStmt) (aStmt)->Cursor.Position= 0; MADB_STMT_FORGET_NEXT_POS(aStmt)
#define MADB_STMT_CLOSE_STMT(aStmt) (aStmt)->stmt.reset()
#define MADB_STMT_SHOULD_STREAM(_a) (DSN_OPTION((_a)->Connection, MADB_OPT_FLAG_NO_CACHE) &&\
Expand Down
8 changes: 1 addition & 7 deletions driver/odbc_3_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@
*************************************************************************************/
#undef MA_ODBC_DEBUG_ALL

#ifdef _WIN32
# include "ma_platform_win32.h"
#else
# include "ma_platform_posix.h"
#endif
#include <sql.h>
#include "ma_api_internal.h"
#include "ma_c_stuff.h"
#include "ma_api_internal.h"
#include "ma_debug.h"

extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion libmariadb
2 changes: 1 addition & 1 deletion test/connstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "tap.h"
#include "ma_dsn.h"
#include "tap.h"

MADB_Dsn *Dsn;
char CreatedDSN[4][32];
Expand Down

0 comments on commit 2fb8781

Please sign in to comment.