Changeset 23507 for trunk/psLib/src/db/psDB.c
- Timestamp:
- Mar 25, 2009, 10:33:30 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/db/psDB.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/db/psDB.c
r22708 r23507 1447 1447 1448 1448 mysqlType *mType; // type tmp variable 1449 static bool isNull = true;// used in a MYSQL_BIND to indicate NULL1449 static my_bool isNull = true; // used in a MYSQL_BIND to indicate NULL 1450 1450 1451 1451 MYSQL_BIND *bind = mysqlRow->bind; … … 1472 1472 bind[i].length = 0; 1473 1473 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; 1477 1475 break; 1478 1476 } … … 1480 1478 bind[i].length = 0; 1481 1479 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; 1485 1481 break; 1486 1482 } … … 1488 1484 bind[i].length = 0; 1489 1485 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; 1493 1487 break; 1494 1488 } … … 1496 1490 bind[i].length = 0; 1497 1491 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; 1501 1493 break; 1502 1494 } … … 1504 1496 bind[i].length = 0; 1505 1497 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; 1509 1499 break; 1510 1500 } … … 1512 1502 bind[i].length = 0; 1513 1503 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; 1517 1505 break; 1518 1506 } … … 1520 1508 bind[i].length = 0; 1521 1509 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; 1525 1511 break; 1526 1512 } … … 1528 1514 bind[i].length = 0; 1529 1515 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; 1533 1517 break; 1534 1518 } … … 1536 1520 bind[i].length = 0; 1537 1521 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; 1541 1523 break; 1542 1524 } … … 1544 1526 bind[i].length = 0; 1545 1527 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; 1549 1529 break; 1550 1530 } … … 1558 1538 bind[i].length = 0; 1559 1539 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; 1563 1541 break; 1564 1542 } … … 1571 1549 bind[i].length = &bind[i].buffer_length; 1572 1550 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; 1576 1552 } else { 1577 1553 // handles the case of NULL as a NULL database value … … 1579 1555 bind[i].length = &bind[i].buffer_length; 1580 1556 bind[i].buffer = NULL; 1581 bind[i].is_null = (my_bool *)&isNull;1557 bind[i].is_null = &isNull; 1582 1558 } 1583 1559 break; … … 1625 1601 bind[i].length = &bind[i].buffer_length; 1626 1602 bind[i].buffer = NULL; 1627 bind[i].is_null = (my_bool *)&isNull;1603 bind[i].is_null = &isNull; 1628 1604 } 1629 1605 break;
Note:
See TracChangeset
for help on using the changeset viewer.
