Changeset 3532
- Timestamp:
- Mar 28, 2005, 12:54:19 PM (21 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 8 edited
-
astronomy/psDB.c (modified) (3 diffs)
-
astronomy/psDB.h (modified) (2 diffs)
-
dataIO/psDB.c (modified) (3 diffs)
-
dataIO/psDB.h (modified) (2 diffs)
-
db/psDB.c (modified) (3 diffs)
-
db/psDB.h (modified) (2 diffs)
-
fileUtils/psDB.c (modified) (3 diffs)
-
fileUtils/psDB.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astronomy/psDB.c
r3408 r3532 8 8 * @author Joshua Hoblitt 9 9 * 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 $ 12 12 * 13 13 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 112 112 psFree(dbh); 113 113 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(); 117 118 psDBMySQLToSQLTableCleanup(); 118 119 psDBPTypeToSQLTableCleanup(); 119 psDBSQLToPTypeTableCleanup();120 120 psDBPTypeToMySQLTableCleanup(); 121 121 } … … 848 848 // find column name and type 849 849 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)) { 851 851 // + column name + _ + column type 852 852 colType = psDBPTypeToSQL(item->type); 853 853 psStringAppend(&query, "%s %s", item->name, colType); 854 854 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)) { 856 860 // + column name + _ + varchar( + length + ) 857 861 psStringAppend(&query, "%s VARCHAR(%s)", item->name, item->data.V); 858 862 } else { 859 863 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); 862 866 863 867 psFree(query); -
trunk/psLib/src/astronomy/psDB.h
r3408 r3532 10 10 * @author Joshua Hoblitt 11 11 * 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 $ 14 14 * 15 15 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 175 175 * 176 176 * The "row" specification uses the psMetadataItem name as the column name. 177 * The field values may be specified in any order. psMetadata types beyond177 * The field values may be specified in any order. psMetadata types beyond 178 178 * PS_META_STR and PS_META_PRIMITIVE are not supported. If fields are 179 179 * specified in "row" that do not exist in "tableName", the insert will fail. -
trunk/psLib/src/dataIO/psDB.c
r3408 r3532 8 8 * @author Joshua Hoblitt 9 9 * 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 $ 12 12 * 13 13 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 112 112 psFree(dbh); 113 113 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(); 117 118 psDBMySQLToSQLTableCleanup(); 118 119 psDBPTypeToSQLTableCleanup(); 119 psDBSQLToPTypeTableCleanup();120 120 psDBPTypeToMySQLTableCleanup(); 121 121 } … … 848 848 // find column name and type 849 849 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)) { 851 851 // + column name + _ + column type 852 852 colType = psDBPTypeToSQL(item->type); 853 853 psStringAppend(&query, "%s %s", item->name, colType); 854 854 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)) { 856 860 // + column name + _ + varchar( + length + ) 857 861 psStringAppend(&query, "%s VARCHAR(%s)", item->name, item->data.V); 858 862 } else { 859 863 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); 862 866 863 867 psFree(query); -
trunk/psLib/src/dataIO/psDB.h
r3408 r3532 10 10 * @author Joshua Hoblitt 11 11 * 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 $ 14 14 * 15 15 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 175 175 * 176 176 * The "row" specification uses the psMetadataItem name as the column name. 177 * The field values may be specified in any order. psMetadata types beyond177 * The field values may be specified in any order. psMetadata types beyond 178 178 * PS_META_STR and PS_META_PRIMITIVE are not supported. If fields are 179 179 * specified in "row" that do not exist in "tableName", the insert will fail. -
trunk/psLib/src/db/psDB.c
r3408 r3532 8 8 * @author Joshua Hoblitt 9 9 * 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 $ 12 12 * 13 13 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 112 112 psFree(dbh); 113 113 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(); 117 118 psDBMySQLToSQLTableCleanup(); 118 119 psDBPTypeToSQLTableCleanup(); 119 psDBSQLToPTypeTableCleanup();120 120 psDBPTypeToMySQLTableCleanup(); 121 121 } … … 848 848 // find column name and type 849 849 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)) { 851 851 // + column name + _ + column type 852 852 colType = psDBPTypeToSQL(item->type); 853 853 psStringAppend(&query, "%s %s", item->name, colType); 854 854 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)) { 856 860 // + column name + _ + varchar( + length + ) 857 861 psStringAppend(&query, "%s VARCHAR(%s)", item->name, item->data.V); 858 862 } else { 859 863 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); 862 866 863 867 psFree(query); -
trunk/psLib/src/db/psDB.h
r3408 r3532 10 10 * @author Joshua Hoblitt 11 11 * 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 $ 14 14 * 15 15 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 175 175 * 176 176 * The "row" specification uses the psMetadataItem name as the column name. 177 * The field values may be specified in any order. psMetadata types beyond177 * The field values may be specified in any order. psMetadata types beyond 178 178 * PS_META_STR and PS_META_PRIMITIVE are not supported. If fields are 179 179 * specified in "row" that do not exist in "tableName", the insert will fail. -
trunk/psLib/src/fileUtils/psDB.c
r3408 r3532 8 8 * @author Joshua Hoblitt 9 9 * 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 $ 12 12 * 13 13 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 112 112 psFree(dbh); 113 113 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(); 117 118 psDBMySQLToSQLTableCleanup(); 118 119 psDBPTypeToSQLTableCleanup(); 119 psDBSQLToPTypeTableCleanup();120 120 psDBPTypeToMySQLTableCleanup(); 121 121 } … … 848 848 // find column name and type 849 849 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)) { 851 851 // + column name + _ + column type 852 852 colType = psDBPTypeToSQL(item->type); 853 853 psStringAppend(&query, "%s %s", item->name, colType); 854 854 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)) { 856 860 // + column name + _ + varchar( + length + ) 857 861 psStringAppend(&query, "%s VARCHAR(%s)", item->name, item->data.V); 858 862 } else { 859 863 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); 862 866 863 867 psFree(query); -
trunk/psLib/src/fileUtils/psDB.h
r3408 r3532 10 10 * @author Joshua Hoblitt 11 11 * 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 $ 14 14 * 15 15 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 175 175 * 176 176 * The "row" specification uses the psMetadataItem name as the column name. 177 * The field values may be specified in any order. psMetadata types beyond177 * The field values may be specified in any order. psMetadata types beyond 178 178 * PS_META_STR and PS_META_PRIMITIVE are not supported. If fields are 179 179 * specified in "row" that do not exist in "tableName", the insert will fail.
Note:
See TracChangeset
for help on using the changeset viewer.
