IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3532


Ignore:
Timestamp:
Mar 28, 2005, 12:54:19 PM (21 years ago)
Author:
asc
Message:

bugfixes

Location:
trunk/psLib/src
Files:
8 edited

Legend:

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

    r3408 r3532  
    88 *  @author Joshua Hoblitt
    99 *
    10  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-03-11 23:17:07 $
     10 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-03-28 22:54:19 $
    1212 *
    1313 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    112112    psFree(dbh);
    113113
    114     // these lookup tables should probably be moved into psDB to prevent them
    115     // from being flushed in the case that a database handle is closed while
    116     // one or more are still open
     114    // ASC WARNING NOTE: the psDBSQLToPTypeTableCleanup cleanup routine
     115    // needs to be called first because it refers to
     116    // psDBGetPTypeToSQLTable ...
     117    psDBSQLToPTypeTableCleanup();
    117118    psDBMySQLToSQLTableCleanup();
    118119    psDBPTypeToSQLTableCleanup();
    119     psDBSQLToPTypeTableCleanup();
    120120    psDBPTypeToMySQLTableCleanup();
    121121}
     
    848848    // find column name and type
    849849    while ((item = psListGetAndIncrement(cursor))) {
    850         if ((item->type == PS_TYPE_S32) || (item->type == PS_TYPE_F32) || (item->type == PS_TYPE_F64)) {
     850        if ((item->type == PS_META_S32) || (item->type == PS_META_F32) || (item->type == PS_META_F64)) {
    851851            // + column name + _ + column type
    852852            colType = psDBPTypeToSQL(item->type);
    853853            psStringAppend(&query, "%s %s", item->name, colType);
    854854            psFree(colType);
    855         } else if (item->type == PS_TYPE_PTR) {
     855        } else if ((item->type == PS_META_STR)         || (item->type == PS_META_VEC)    ||
     856                   (item->type == PS_META_IMG)         || (item->type == PS_META_HASH)   ||
     857                   (item->type == PS_META_LOOKUPTABLE) || (item->type == PS_META_JPEG)   ||
     858                   (item->type == PS_META_PNG)         || (item->type == PS_META_ASTROM) ||
     859                   (item->type == PS_META_UNKNOWN)) {
    856860            // + column name + _ + varchar( + length + )
    857861            psStringAppend(&query, "%s VARCHAR(%s)", item->name, item->data.V);
    858862        } else {
    859863            psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    860                     "FIXME: Only type of PS_TYPE_S32, PS_TYPE_F32, PS_TYPE_F64, "
    861                     "and PS_TYPE_PTR are supported.");
     864                    "FIXME: Only type of PS_META_S32, PS_META_F32, PS_META_F64, "
     865                    "and PS_META_* pointer types are supported, (not %d).", item->type);
    862866
    863867            psFree(query);
  • trunk/psLib/src/astronomy/psDB.h

    r3408 r3532  
    1010 *  @author Joshua Hoblitt
    1111 *
    12  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-03-11 23:17:07 $
     12 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-03-28 22:54:19 $
    1414 *
    1515 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    175175 *
    176176 * The "row" specification uses the psMetadataItem name as the column name.
    177  * The field values maybe specified in any order.  psMetadata types beyond
     177 * The field values may be specified in any order.  psMetadata types beyond
    178178 * PS_META_STR and PS_META_PRIMITIVE are not supported.  If fields are
    179179 * specified in "row" that do not exist in "tableName", the insert will fail.
  • trunk/psLib/src/dataIO/psDB.c

    r3408 r3532  
    88 *  @author Joshua Hoblitt
    99 *
    10  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-03-11 23:17:07 $
     10 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-03-28 22:54:19 $
    1212 *
    1313 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    112112    psFree(dbh);
    113113
    114     // these lookup tables should probably be moved into psDB to prevent them
    115     // from being flushed in the case that a database handle is closed while
    116     // one or more are still open
     114    // ASC WARNING NOTE: the psDBSQLToPTypeTableCleanup cleanup routine
     115    // needs to be called first because it refers to
     116    // psDBGetPTypeToSQLTable ...
     117    psDBSQLToPTypeTableCleanup();
    117118    psDBMySQLToSQLTableCleanup();
    118119    psDBPTypeToSQLTableCleanup();
    119     psDBSQLToPTypeTableCleanup();
    120120    psDBPTypeToMySQLTableCleanup();
    121121}
     
    848848    // find column name and type
    849849    while ((item = psListGetAndIncrement(cursor))) {
    850         if ((item->type == PS_TYPE_S32) || (item->type == PS_TYPE_F32) || (item->type == PS_TYPE_F64)) {
     850        if ((item->type == PS_META_S32) || (item->type == PS_META_F32) || (item->type == PS_META_F64)) {
    851851            // + column name + _ + column type
    852852            colType = psDBPTypeToSQL(item->type);
    853853            psStringAppend(&query, "%s %s", item->name, colType);
    854854            psFree(colType);
    855         } else if (item->type == PS_TYPE_PTR) {
     855        } else if ((item->type == PS_META_STR)         || (item->type == PS_META_VEC)    ||
     856                   (item->type == PS_META_IMG)         || (item->type == PS_META_HASH)   ||
     857                   (item->type == PS_META_LOOKUPTABLE) || (item->type == PS_META_JPEG)   ||
     858                   (item->type == PS_META_PNG)         || (item->type == PS_META_ASTROM) ||
     859                   (item->type == PS_META_UNKNOWN)) {
    856860            // + column name + _ + varchar( + length + )
    857861            psStringAppend(&query, "%s VARCHAR(%s)", item->name, item->data.V);
    858862        } else {
    859863            psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    860                     "FIXME: Only type of PS_TYPE_S32, PS_TYPE_F32, PS_TYPE_F64, "
    861                     "and PS_TYPE_PTR are supported.");
     864                    "FIXME: Only type of PS_META_S32, PS_META_F32, PS_META_F64, "
     865                    "and PS_META_* pointer types are supported, (not %d).", item->type);
    862866
    863867            psFree(query);
  • trunk/psLib/src/dataIO/psDB.h

    r3408 r3532  
    1010 *  @author Joshua Hoblitt
    1111 *
    12  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-03-11 23:17:07 $
     12 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-03-28 22:54:19 $
    1414 *
    1515 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    175175 *
    176176 * The "row" specification uses the psMetadataItem name as the column name.
    177  * The field values maybe specified in any order.  psMetadata types beyond
     177 * The field values may be specified in any order.  psMetadata types beyond
    178178 * PS_META_STR and PS_META_PRIMITIVE are not supported.  If fields are
    179179 * specified in "row" that do not exist in "tableName", the insert will fail.
  • trunk/psLib/src/db/psDB.c

    r3408 r3532  
    88 *  @author Joshua Hoblitt
    99 *
    10  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-03-11 23:17:07 $
     10 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-03-28 22:54:19 $
    1212 *
    1313 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    112112    psFree(dbh);
    113113
    114     // these lookup tables should probably be moved into psDB to prevent them
    115     // from being flushed in the case that a database handle is closed while
    116     // one or more are still open
     114    // ASC WARNING NOTE: the psDBSQLToPTypeTableCleanup cleanup routine
     115    // needs to be called first because it refers to
     116    // psDBGetPTypeToSQLTable ...
     117    psDBSQLToPTypeTableCleanup();
    117118    psDBMySQLToSQLTableCleanup();
    118119    psDBPTypeToSQLTableCleanup();
    119     psDBSQLToPTypeTableCleanup();
    120120    psDBPTypeToMySQLTableCleanup();
    121121}
     
    848848    // find column name and type
    849849    while ((item = psListGetAndIncrement(cursor))) {
    850         if ((item->type == PS_TYPE_S32) || (item->type == PS_TYPE_F32) || (item->type == PS_TYPE_F64)) {
     850        if ((item->type == PS_META_S32) || (item->type == PS_META_F32) || (item->type == PS_META_F64)) {
    851851            // + column name + _ + column type
    852852            colType = psDBPTypeToSQL(item->type);
    853853            psStringAppend(&query, "%s %s", item->name, colType);
    854854            psFree(colType);
    855         } else if (item->type == PS_TYPE_PTR) {
     855        } else if ((item->type == PS_META_STR)         || (item->type == PS_META_VEC)    ||
     856                   (item->type == PS_META_IMG)         || (item->type == PS_META_HASH)   ||
     857                   (item->type == PS_META_LOOKUPTABLE) || (item->type == PS_META_JPEG)   ||
     858                   (item->type == PS_META_PNG)         || (item->type == PS_META_ASTROM) ||
     859                   (item->type == PS_META_UNKNOWN)) {
    856860            // + column name + _ + varchar( + length + )
    857861            psStringAppend(&query, "%s VARCHAR(%s)", item->name, item->data.V);
    858862        } else {
    859863            psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    860                     "FIXME: Only type of PS_TYPE_S32, PS_TYPE_F32, PS_TYPE_F64, "
    861                     "and PS_TYPE_PTR are supported.");
     864                    "FIXME: Only type of PS_META_S32, PS_META_F32, PS_META_F64, "
     865                    "and PS_META_* pointer types are supported, (not %d).", item->type);
    862866
    863867            psFree(query);
  • trunk/psLib/src/db/psDB.h

    r3408 r3532  
    1010 *  @author Joshua Hoblitt
    1111 *
    12  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-03-11 23:17:07 $
     12 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-03-28 22:54:19 $
    1414 *
    1515 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    175175 *
    176176 * The "row" specification uses the psMetadataItem name as the column name.
    177  * The field values maybe specified in any order.  psMetadata types beyond
     177 * The field values may be specified in any order.  psMetadata types beyond
    178178 * PS_META_STR and PS_META_PRIMITIVE are not supported.  If fields are
    179179 * specified in "row" that do not exist in "tableName", the insert will fail.
  • trunk/psLib/src/fileUtils/psDB.c

    r3408 r3532  
    88 *  @author Joshua Hoblitt
    99 *
    10  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-03-11 23:17:07 $
     10 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-03-28 22:54:19 $
    1212 *
    1313 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    112112    psFree(dbh);
    113113
    114     // these lookup tables should probably be moved into psDB to prevent them
    115     // from being flushed in the case that a database handle is closed while
    116     // one or more are still open
     114    // ASC WARNING NOTE: the psDBSQLToPTypeTableCleanup cleanup routine
     115    // needs to be called first because it refers to
     116    // psDBGetPTypeToSQLTable ...
     117    psDBSQLToPTypeTableCleanup();
    117118    psDBMySQLToSQLTableCleanup();
    118119    psDBPTypeToSQLTableCleanup();
    119     psDBSQLToPTypeTableCleanup();
    120120    psDBPTypeToMySQLTableCleanup();
    121121}
     
    848848    // find column name and type
    849849    while ((item = psListGetAndIncrement(cursor))) {
    850         if ((item->type == PS_TYPE_S32) || (item->type == PS_TYPE_F32) || (item->type == PS_TYPE_F64)) {
     850        if ((item->type == PS_META_S32) || (item->type == PS_META_F32) || (item->type == PS_META_F64)) {
    851851            // + column name + _ + column type
    852852            colType = psDBPTypeToSQL(item->type);
    853853            psStringAppend(&query, "%s %s", item->name, colType);
    854854            psFree(colType);
    855         } else if (item->type == PS_TYPE_PTR) {
     855        } else if ((item->type == PS_META_STR)         || (item->type == PS_META_VEC)    ||
     856                   (item->type == PS_META_IMG)         || (item->type == PS_META_HASH)   ||
     857                   (item->type == PS_META_LOOKUPTABLE) || (item->type == PS_META_JPEG)   ||
     858                   (item->type == PS_META_PNG)         || (item->type == PS_META_ASTROM) ||
     859                   (item->type == PS_META_UNKNOWN)) {
    856860            // + column name + _ + varchar( + length + )
    857861            psStringAppend(&query, "%s VARCHAR(%s)", item->name, item->data.V);
    858862        } else {
    859863            psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    860                     "FIXME: Only type of PS_TYPE_S32, PS_TYPE_F32, PS_TYPE_F64, "
    861                     "and PS_TYPE_PTR are supported.");
     864                    "FIXME: Only type of PS_META_S32, PS_META_F32, PS_META_F64, "
     865                    "and PS_META_* pointer types are supported, (not %d).", item->type);
    862866
    863867            psFree(query);
  • trunk/psLib/src/fileUtils/psDB.h

    r3408 r3532  
    1010 *  @author Joshua Hoblitt
    1111 *
    12  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-03-11 23:17:07 $
     12 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-03-28 22:54:19 $
    1414 *
    1515 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    175175 *
    176176 * The "row" specification uses the psMetadataItem name as the column name.
    177  * The field values maybe specified in any order.  psMetadata types beyond
     177 * The field values may be specified in any order.  psMetadata types beyond
    178178 * PS_META_STR and PS_META_PRIMITIVE are not supported.  If fields are
    179179 * specified in "row" that do not exist in "tableName", the insert will fail.
Note: See TracChangeset for help on using the changeset viewer.