sphinxse mysql 5.6编译错误

来源:互联网 发布:明教 捏脸数据 编辑:程序博客网 时间:2024/05/17 06:49

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());


0 0
原创粉丝点击