Ignore:
Timestamp:
Feb 14, 2000, 6:18:31 PM (26 years ago)
Author:
bird
Message:

Bugfixes. Nearly there now!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/database/db.cpp

    r2773 r2776  
    1 /* $Id: db.cpp,v 1.9 2000-02-14 13:49:13 bird Exp $ *
     1/* $Id: db.cpp,v 1.10 2000-02-14 17:18:31 bird Exp $ *
    22 *
    33 * DB - contains all database routines.
     
    412412    MYSQL_ROW    row;
    413413    int          rc;
    414     char         szQuery[256];
     414    char         szQuery[1024];
    415415
    416416    /*
     
    449449            if (lDll >= 0 && pFnFindBuf->cFns != 0)
    450450            {
    451                 int cFnsThisDll, cFnsAliasesAndThisDll, i;
     451                int cFnsThisDll, cFnsAliasesAndThisDll, i, f;
    452452
    453453                /*
     
    547547                                         */
    548548                                        sprintf(&szQuery[0], "UPDATE function SET aliasfn = (-2) "
    549                                                              "WHERE (",
     549                                                             "WHERE refcode IN (",
    550550                                                lDll, pszFunctionName);
    551                                         for (i = 0; i < cFnsThisDll; i++)
    552                                         {
    553                                             if (i != 0) strcat(&szQuery[0], " OR");
    554                                             sprintf(&szQuery[strlen(szQuery)], " refcode = %ld", pFnFindBuf->alRefCode[i]);
    555                                         }
     551                                        for (f = 0, i = 0; i < cFnsThisDll; i++)
     552                                            if (pFnFindBuf->alAliasFn[i] != ALIAS_DONTMIND)
     553                                                sprintf(&szQuery[strlen(&szQuery[0])],
     554                                                        f++ != 0 ? ", %ld" : "%ld", pFnFindBuf->alRefCode[i]);
    556555                                        strcat(&szQuery[0], ") AND aliasfn <> (-2)");
    557 
    558                                         rc = mysql_query5(pmysql, &szQuery[0]);
     556                                        if (f > 0)
     557                                            rc = mysql_query5(pmysql, &szQuery[0]);
     558                                        else
     559                                            rc = 0;
    559560                                        if (rc >= 0 && cFnsAliasesAndThisDll < pFnFindBuf->cFns)
    560561                                        {
     
    566567                                                    pFnFindBuf->alRefCode[0]);
    567568                                            for (i = cFnsAliasesAndThisDll; i < pFnFindBuf->cFns; i++)
     569                                            {
    568570                                                sprintf(&szQuery[strlen(&szQuery[0])],
    569                                                         i > 0 ? ", %ld" : "%ld", pFnFindBuf->alRefCode[i]);
     571                                                        i > cFnsAliasesAndThisDll ? ", %ld" : "%ld", pFnFindBuf->alRefCode[i]);
     572                                            }
    570573                                            strcat(&szQuery[0], ")");
    571574                                            rc = mysql_query6(pmysql, &szQuery[0]);
     
    780783                    {
    781784                        sprintf(pszQuery, "UPDATE parameter SET type = '%s', name = '%s' "
    782                                 "WHERE function = (%ld) AND sequencenbr == (%ld)",
     785                                "WHERE function = (%ld) AND sequencenbr = (%ld)",
    783786                                pFnDesc->apszParamType[i] != NULL ? pFnDesc->apszParamType[i] : "",
    784787                                pFnDesc->apszParamName[i] != NULL ? pFnDesc->apszParamName[i] : "",
Note: See TracChangeset for help on using the changeset viewer.