antiblock
diamwall
  • Chatbox

    You don't have permission to chat.
    Load More

Archived

This topic is now archived and is closed to further replies.

  • 0
@Metin2

Erro de compilação

Question

Olá a todos, eu estou com pequeno problema de compilação da minha source, eu implementei um código no arquivo questlua_global.cpp e vem me da erro.. alguém sabe a solução para o erro ? deixo aqui img e código usado..

 

NrUpyCu.png

 

Citar

    int _mysql_direct_query(lua_State* L)
    {
        if (!lua_isstring(L, 1))
            return 0;

        int i=0, m=1;
        MYSQL_ROW row;
        MYSQL_FIELD * field;
        MYSQL_RES * result;
        std::unique_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery(lua_tostring(L, 1)));
        if (pMsg.get())
        {
            lua_pushnumber(L, pMsg->Get()->uiAffectedRows);
            lua_newtable(L);
            if ((result = pMsg->Get()->pSQLResult) && !(pMsg->Get()->uiAffectedRows == 0 || pMsg->Get()->uiAffectedRows == (uint32_t)-1))
            {
                while((row = mysql_fetch_row(result)))
                {
                    lua_pushnumber(L, m);
                    lua_newtable(L);
                    while((field = mysql_fetch_field(result)))
                    {
                        lua_pushstring(L, field->name);
                        if (!(field->flags & NOT_NULL_FLAG) && (row==NULL))
                        {
                            lua_pushnil(L);
                        }
                        else if (IS_NUM(field->type))
                        {
                            double val = NAN;
                            lua_pushnumber(L, (sscanf(row,"%lf",&val)==1)?val:NAN);
                        }
                        else if (field->type == MYSQL_TYPE_BLOB)
                        {
                            lua_newtable(L);
                            for (DWORD iBlob=0; iBlob < field->max_length; iBlob++)
                            {
                                lua_pushnumber(L, row[iBlob]);
                                lua_rawseti(L, -2, iBlob+1);
                            }
                        }
                        else
                            lua_pushstring(L, row);
                        lua_rawset(L, -3);
                        i++;
                    }
                    mysql_field_seek(result, 0);
                    i=0;
                    lua_rawset(L, -3);
                    m++;
                }
            }
        }
        else {lua_pushnumber(L, 0); lua_newtable(L);}

        return 2;
    }

 

Share this post


Link to post
Share on other sites

0 answers to this question

There have been no answers to this question yet