diff options
Diffstat (limited to 'storage/sphinx')
-rw-r--r-- | storage/sphinx/CMakeLists.txt | 10 | ||||
-rw-r--r-- | storage/sphinx/ha_sphinx.cc | 28 | ||||
-rw-r--r-- | storage/sphinx/ha_sphinx.h | 2 | ||||
-rw-r--r-- | storage/sphinx/snippets_udf.cc | 3 |
4 files changed, 28 insertions, 15 deletions
diff --git a/storage/sphinx/CMakeLists.txt b/storage/sphinx/CMakeLists.txt index e50ba74ba90..7cae7982e05 100644 --- a/storage/sphinx/CMakeLists.txt +++ b/storage/sphinx/CMakeLists.txt @@ -5,6 +5,16 @@ ADD_DEFINITIONS(-DMYSQL_SERVER) MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-write-strings") IF(MSVC) + # Temporarily disable "conversion from size_t .." warnings + IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267") + ENDIF() + # Disable warning about deprecated functions, inet_aton + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996") + STRING(REPLACE "/permissive-" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" ) +ENDIF() + +IF(MSVC) LINK_LIBRARIES(ws2_32) ENDIF(MSVC) diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc index adb9d63635d..0540ff082ce 100644 --- a/storage/sphinx/ha_sphinx.cc +++ b/storage/sphinx/ha_sphinx.cc @@ -22,6 +22,7 @@ #define _CRT_NONSTDC_NO_DEPRECATE 1 #endif +#include <my_global.h> #include <mysql_version.h> #if MYSQL_VERSION_ID>=50515 @@ -1031,7 +1032,7 @@ static bool ParseUrl ( CSphSEShare * share, TABLE * table, bool bCreate ) for ( int i=0; i<share->m_iTableFields; i++ ) { - share->m_sTableField[i] = sphDup ( table->field[i]->field_name ); + share->m_sTableField[i] = sphDup ( table->field[i]->field_name.str ); share->m_eTableFieldType[i] = table->field[i]->type(); } } @@ -1158,7 +1159,7 @@ static bool ParseUrl ( CSphSEShare * share, TABLE * table, bool bCreate ) if ( !bOk ) { my_error ( bCreate ? ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE : ER_FOREIGN_DATA_STRING_INVALID, - MYF(0), table->s->connect_string ); + MYF(0), table->s->connect_string.str); } else { if ( share ) @@ -2338,7 +2339,7 @@ int ha_sphinx::write_row ( byte * ) for ( Field ** ppField = table->field; *ppField; ppField++ ) { - sQuery.append ( (*ppField)->field_name ); + sQuery.append ( (*ppField)->field_name.str ); if ( ppField[1] ) sQuery.append ( ", " ); } @@ -2464,7 +2465,7 @@ int ha_sphinx::delete_row ( const byte * ) } -int ha_sphinx::update_row ( const byte *, byte * ) +int ha_sphinx::update_row ( const byte *, const byte * ) { SPH_ENTER_METHOD(); SPH_RET ( HA_ERR_WRONG_COMMAND ); @@ -3428,7 +3429,7 @@ int ha_sphinx::create ( const char * name, TABLE * table_arg, HA_CREATE_INFO * ) if ( eType!=MYSQL_TYPE_TIMESTAMP && !IsIntegerFieldType(eType) && eType!=MYSQL_TYPE_VARCHAR && eType!=MYSQL_TYPE_FLOAT ) { my_snprintf ( sError, sizeof(sError), "%s: %dth column (attribute %s) MUST be integer, bigint, timestamp, varchar, or float", - name, i+1, table_arg->field[i]->field_name ); + name, i+1, table_arg->field[i]->field_name.str ); break; } } @@ -3440,10 +3441,10 @@ int ha_sphinx::create ( const char * name, TABLE * table_arg, HA_CREATE_INFO * ) if ( table_arg->s->keys!=1 || table_arg->key_info[0].user_defined_key_parts!=1 || - strcasecmp ( table_arg->key_info[0].key_part[0].field->field_name, table_arg->field[2]->field_name ) ) + strcasecmp ( table_arg->key_info[0].key_part[0].field->field_name.str, table->field[2]->field_name.str ) ) { my_snprintf ( sError, sizeof(sError), "%s: there must be an index on '%s' column", - name, table_arg->field[2]->field_name ); + name, table->field[2]->field_name.str ); break; } @@ -3458,7 +3459,7 @@ int ha_sphinx::create ( const char * name, TABLE * table_arg, HA_CREATE_INFO * ) sError[0] = '\0'; // check that 1st column is id, is of int type, and has an index - if ( strcmp ( table_arg->field[0]->field_name, "id" ) ) + if ( strcmp ( table_arg->field[0]->field_name.str, "id" ) ) { my_snprintf ( sError, sizeof(sError), "%s: 1st column must be called 'id'", name ); break; @@ -3474,7 +3475,7 @@ int ha_sphinx::create ( const char * name, TABLE * table_arg, HA_CREATE_INFO * ) if ( table_arg->s->keys!=1 || table_arg->key_info[0].user_defined_key_parts!=1 || - strcasecmp ( table_arg->key_info[0].key_part[0].field->field_name, "id" ) ) + strcasecmp ( table_arg->key_info[0].key_part[0].field->field_name.str, "id" ) ) { my_snprintf ( sError, sizeof(sError), "%s: 'id' column must be indexed", name ); break; @@ -3487,7 +3488,7 @@ int ha_sphinx::create ( const char * name, TABLE * table_arg, HA_CREATE_INFO * ) if ( eType!=MYSQL_TYPE_TIMESTAMP && !IsIntegerFieldType(eType) && eType!=MYSQL_TYPE_VARCHAR && eType!=MYSQL_TYPE_FLOAT ) { my_snprintf ( sError, sizeof(sError), "%s: column %d(%s) is of unsupported type (use int/bigint/timestamp/varchar/float)", - name, i+1, table_arg->field[i]->field_name ); + name, i+1, table_arg->field[i]->field_name.str ); break; } } @@ -3501,8 +3502,11 @@ int ha_sphinx::create ( const char * name, TABLE * table_arg, HA_CREATE_INFO * ) // report and bail if ( sError[0] ) { - my_error ( ER_CANT_CREATE_TABLE, MYF(0), - table_arg->s->db.str, table_arg->s->table_name, sError ); + my_printf_error(ER_CANT_CREATE_TABLE, + "Can\'t create table %s.%s (Error: %s)", + MYF(0), + table_arg->s->db.str, + table_arg->s->table_name.str, sError); SPH_RET(-1); } diff --git a/storage/sphinx/ha_sphinx.h b/storage/sphinx/ha_sphinx.h index c310deb7060..8e6af908aab 100644 --- a/storage/sphinx/ha_sphinx.h +++ b/storage/sphinx/ha_sphinx.h @@ -86,7 +86,7 @@ public: int close (); int write_row ( byte * buf ); - int update_row ( const byte * old_data, byte * new_data ); + int update_row ( const byte * old_data, const byte * new_data ); int delete_row ( const byte * buf ); int extra ( enum ha_extra_function op ); diff --git a/storage/sphinx/snippets_udf.cc b/storage/sphinx/snippets_udf.cc index edde806f682..77f76876819 100644 --- a/storage/sphinx/snippets_udf.cc +++ b/storage/sphinx/snippets_udf.cc @@ -13,8 +13,7 @@ // did not, you can find it at http://www.gnu.org/ // -#include <my_config.h> -#include <stdio.h> +#include <my_global.h> #include <string.h> #include <assert.h> |