1. 程式人生 > >sphinxse mysql 5.6編譯錯誤

sphinxse mysql 5.6編譯錯誤

ha_sphinx.h:133: error: ISO C++ forbids declaration of ‘COND’ with no type

ha_sphinx.h:133: error: ‘COND’ declared as a ‘virtual’ field

ha_sphinx.h:133: error: expected ‘;’ before ‘*’ token

ha_sphinx.cc:1183: error: invalid conversion from ‘const CHARSET_INFO*’ to ‘CHARSET_INFO*’


// check index
if (
table->s->keys!=1 ||
table->key_info[0].key_parts!=1 ||
strcasecmp ( table->key_info[0].key_part[0].field->field_name, table->field[2]->field_name ) )
{
my_snprintf ( sError, sizeof(sError), "%s: there must be an index on '%s' column",
name, table->field[2]->field_name );
break;
}

 

改為

 

// check index
if (
table->s->keys!=1 ||
table->key_info[0].user_defined_key_parts!=1 ||
strcasecmp ( table->key_info[0].key_part[0].field->field_name, table->field[2]->field_name ) )
{
my_snprintf ( sError, sizeof(sError), "%s: there must be an index on '%s' column",
name, table->field[2]->field_name );
break;
}

 


// check index
if (
table->s->keys!=1 ||
table->key_info[0].key_parts!=1 ||
strcasecmp ( table->key_info[0].key_part[0].field->field_name, "id" ) )
{
my_snprintf ( sError, sizeof(sError), "%s: 'id' column must be indexed", name );
break;
}

 


改為

 

// check index
if (
table->s->keys!=1 ||
table->key_info[0].user_defined_key_parts!=1 ||
strcasecmp ( table->key_info[0].key_part[0].field->field_name, "id" ) )
{
my_snprintf ( sError, sizeof(sError), "%s: 'id' column must be indexed", name );
break;
}

 

從型別‘const CHARSET_INFO*’到型別‘CHARSET_INFO*’的轉換無效
if ( !pShare->m_bSphinxQL )
pShare->m_pTableQueryCharset = table->field[2]->charset();

 

改為:

 

if ( !pShare->m_bSphinxQL )
pShare->m_pTableQueryCharset = const_cast<CHARSET_INFO *>(table->field[2]->charset());




// copy the query, and let know that we intercepted this condition
               Item_string * pString = (Item_string *) args[1];
               pTls->m_bQuery = true;
               strncpy ( pTls->m_sQuery, pString->str_value.c_ptr(), sizeof(pTls->m_sQuery) );
               pTls->m_sQuery[sizeof(pTls->m_sQuery)-1] = '\0';
               pTls->m_pQueryCharset = pString->str_value.charset();


改為


// copy the query, and let know that we intercepted this condition
               Item_string * pString = (Item_string *) args[1];
               pTls->m_bQuery = true;
               strncpy ( pTls->m_sQuery, pString->str_value.c_ptr(), sizeof(pTls->m_sQuery) );
               pTls->m_sQuery[sizeof(pTls->m_sQuery)-1] = '\0';
               pTls->m_pQueryCharset = const_cast<CHARSET_INFO *>(pString->str_value.charset());