IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 25, 2009, 10:33:30 AM (17 years ago)
Author:
Paul Price
Message:

Resolving ticket 1109: bus error in pxinject was due to endian bug with is_null in psDBPackMySQLRow (casting bool* to my_bool*).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/db/psDB.c

    r22708 r23507  
    14471447
    14481448    mysqlType       *mType;             // type tmp variable
    1449     static bool     isNull = true;      // used in a MYSQL_BIND to indicate NULL
     1449    static my_bool isNull = true;       // used in a MYSQL_BIND to indicate NULL
    14501450
    14511451    MYSQL_BIND *bind = mysqlRow->bind;
     
    14721472                bind[i].length  = 0;
    14731473                bind[i].buffer  = &item->data.U8;
    1474                 bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.U8)
    1475                                   ? (my_bool *)&isNull
    1476                                   : NULL;
     1474                bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.U8) ? &isNull : NULL;
    14771475                break;
    14781476            }
     
    14801478                bind[i].length  = 0;
    14811479                bind[i].buffer  = &item->data.U16;
    1482                 bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.U16)
    1483                                   ? (my_bool *)&isNull
    1484                                   : NULL;
     1480                bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.U16) ? &isNull : NULL;
    14851481                break;
    14861482            }
     
    14881484                bind[i].length  = 0;
    14891485                bind[i].buffer  = &item->data.U32;
    1490                 bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.U32)
    1491                                   ? (my_bool *)&isNull
    1492                                   : NULL;
     1486                bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.U32) ? &isNull : NULL;
    14931487                break;
    14941488            }
     
    14961490                bind[i].length  = 0;
    14971491                bind[i].buffer  = &item->data.U64;
    1498                 bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.U64)
    1499                                   ? (my_bool *)&isNull
    1500                                   : NULL;
     1492                bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.U64) ? &isNull : NULL;
    15011493                break;
    15021494            }
     
    15041496                bind[i].length  = 0;
    15051497                bind[i].buffer  = &item->data.S8;
    1506                 bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.S8)
    1507                                   ? (my_bool *)&isNull
    1508                                   : NULL;
     1498                bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.S8) ? &isNull : NULL;
    15091499                break;
    15101500            }
     
    15121502                bind[i].length  = 0;
    15131503                bind[i].buffer  = &item->data.S16;
    1514                 bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.S16)
    1515                                   ? (my_bool *)&isNull
    1516                                   : NULL;
     1504                bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.S16) ? &isNull : NULL;
    15171505                break;
    15181506            }
     
    15201508                bind[i].length  = 0;
    15211509                bind[i].buffer  = &item->data.S32;
    1522                 bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.S32)
    1523                                   ? (my_bool *)&isNull
    1524                                   : NULL;
     1510                bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.S32) ? &isNull : NULL;
    15251511                break;
    15261512            }
     
    15281514                bind[i].length  = 0;
    15291515                bind[i].buffer  = &item->data.S64;
    1530                 bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.S64)
    1531                                   ? (my_bool *)&isNull
    1532                                   : NULL;
     1516                bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.S64) ? &isNull : NULL;
    15331517                break;
    15341518            }
     
    15361520                bind[i].length  = 0;
    15371521                bind[i].buffer  = &item->data.F32;
    1538                 bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.F32)
    1539                                   ? (my_bool *)&isNull
    1540                                   : NULL;
     1522                bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.F32) ? &isNull : NULL;
    15411523                break;
    15421524            }
     
    15441526                bind[i].length  = 0;
    15451527                bind[i].buffer  = &item->data.F64;
    1546                 bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.F64)
    1547                                   ? (my_bool *)&isNull
    1548                                   : NULL;
     1528                bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.F64) ? &isNull : NULL;
    15491529                break;
    15501530            }
     
    15581538                bind[i].length  = 0;
    15591539                bind[i].buffer  = &item->data.B;
    1560                 bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.B)
    1561                                   ? (my_bool *)&isNull
    1562                                   : NULL;
     1540                bind[i].is_null = psDBIsPTypeNaN(item->type, &item->data.B) ? &isNull : NULL;
    15631541                break;
    15641542            }
     
    15711549                    bind[i].length  = &bind[i].buffer_length;
    15721550                    bind[i].buffer  = psStringCopy(item->data.V);
    1573                     bind[i].is_null = *item->data.str == '\0'
    1574                                       ? (my_bool *)&isNull
    1575                                       : NULL;
     1551                    bind[i].is_null = *item->data.str == '\0' ? &isNull : NULL;
    15761552                } else {
    15771553                    // handles the case of NULL as a NULL database value
     
    15791555                    bind[i].length  = &bind[i].buffer_length;
    15801556                    bind[i].buffer  = NULL;
    1581                     bind[i].is_null = (my_bool *)&isNull;
     1557                    bind[i].is_null = &isNull;
    15821558                }
    15831559                break;
     
    16251601                    bind[i].length  = &bind[i].buffer_length;
    16261602                    bind[i].buffer  = NULL;
    1627                     bind[i].is_null = (my_bool *)&isNull;
     1603                    bind[i].is_null = &isNull;
    16281604                }
    16291605                break;
Note: See TracChangeset for help on using the changeset viewer.