Changeset 14169 for trunk/ippdb/src/ippdb.c
- Timestamp:
- Jul 12, 2007, 12:27:55 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippdb/src/ippdb.c (modified) (65 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/src/ippdb.c
r14061 r14169 43 43 #define GUIDEPENDINGEXP_TABLE_NAME "guidePendingExp" 44 44 #define CHIPRUN_TABLE_NAME "chipRun" 45 #define CHIPINPUTIMFILE_TABLE_NAME "chipInputImfile"46 45 #define CHIPPROCESSEDIMFILE_TABLE_NAME "chipProcessedImfile" 47 46 #define CHIPMASK_TABLE_NAME "chipMask" … … 2526 2525 static void newExpRowFree(newExpRow *object); 2527 2526 2528 newExpRow *newExpRowAlloc(psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state )2527 newExpRow *newExpRowAlloc(psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state, const char *reduction) 2529 2528 { 2530 2529 newExpRow *_object; … … 2540 2539 _object->workdir = psStringCopy(workdir); 2541 2540 _object->workdir_state = psStringCopy(workdir_state); 2541 _object->reduction = psStringCopy(reduction); 2542 2542 2543 2543 return _object; … … 2552 2552 psFree(object->workdir); 2553 2553 psFree(object->workdir_state); 2554 psFree(object->reduction); 2554 2555 } 2555 2556 … … 2592 2593 return false; 2593 2594 } 2595 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, "Reduction class", "64")) { 2596 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 2597 psFree(md); 2598 return false; 2599 } 2594 2600 2595 2601 bool status = psDBCreateTable(dbh, NEWEXP_TABLE_NAME, md); … … 2605 2611 } 2606 2612 2607 bool newExpInsert(psDB * dbh, psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state )2613 bool newExpInsert(psDB * dbh, psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state, const char *reduction) 2608 2614 { 2609 2615 psMetadata *md = psMetadataAlloc(); … … 2640 2646 if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir_state", PS_DATA_STRING, NULL, workdir_state)) { 2641 2647 psError(PS_ERR_UNKNOWN, false, "failed to add item workdir_state"); 2648 psFree(md); 2649 return false; 2650 } 2651 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, reduction)) { 2652 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 2642 2653 psFree(md); 2643 2654 return false; … … 2666 2677 bool newExpInsertObject(psDB *dbh, newExpRow *object) 2667 2678 { 2668 return newExpInsert(dbh, object->exp_id, object->tmp_exp_name, object->tmp_camera, object->tmp_telescope, object->state, object->workdir, object->workdir_state );2679 return newExpInsert(dbh, object->exp_id, object->tmp_exp_name, object->tmp_camera, object->tmp_telescope, object->state, object->workdir, object->workdir_state, object->reduction); 2669 2680 } 2670 2681 … … 2774 2785 return false; 2775 2786 } 2787 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, object->reduction)) { 2788 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 2789 psFree(md); 2790 return false; 2791 } 2776 2792 2777 2793 … … 2818 2834 return false; 2819 2835 } 2820 2821 return newExpRowAlloc(exp_id, tmp_exp_name, tmp_camera, tmp_telescope, state, workdir, workdir_state); 2836 char* reduction = psMetadataLookupPtr(&status, md, "reduction"); 2837 if (!status) { 2838 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item reduction"); 2839 return false; 2840 } 2841 2842 return newExpRowAlloc(exp_id, tmp_exp_name, tmp_camera, tmp_telescope, state, workdir, workdir_state, reduction); 2822 2843 } 2823 2844 psArray *newExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 3248 3269 static void rawExpRowFree(rawExpRow *object); 3249 3270 3250 rawExpRow *rawExpRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char * filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, psS16 fault)3271 rawExpRow *rawExpRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, psS16 fault) 3251 3272 { 3252 3273 rawExpRow *_object; … … 3264 3285 _object->filelevel = psStringCopy(filelevel); 3265 3286 _object->workdir = psStringCopy(workdir); 3287 _object->reduction = psStringCopy(reduction); 3266 3288 _object->filter = psStringCopy(filter); 3267 3289 _object->airmass = airmass; … … 3299 3321 psFree(object->filelevel); 3300 3322 psFree(object->workdir); 3323 psFree(object->reduction); 3301 3324 psFree(object->filter); 3302 3325 psFree(object->object); … … 3351 3374 return false; 3352 3375 } 3376 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, "Reduction class", "64")) { 3377 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 3378 psFree(md); 3379 return false; 3380 } 3353 3381 if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "64")) { 3354 3382 psError(PS_ERR_UNKNOWN, false, "failed to add item filter"); … … 3469 3497 } 3470 3498 3471 bool rawExpInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char * filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, psS16 fault)3499 bool rawExpInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, psS16 fault) 3472 3500 { 3473 3501 psMetadata *md = psMetadataAlloc(); … … 3514 3542 if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, workdir)) { 3515 3543 psError(PS_ERR_UNKNOWN, false, "failed to add item workdir"); 3544 psFree(md); 3545 return false; 3546 } 3547 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, reduction)) { 3548 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 3516 3549 psFree(md); 3517 3550 return false; … … 3645 3678 bool rawExpInsertObject(psDB *dbh, rawExpRow *object) 3646 3679 { 3647 return rawExpInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_tag, object->exp_type, object->filelevel, object->workdir, object-> filter, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->solang, object->fault);3680 return rawExpInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_tag, object->exp_type, object->filelevel, object->workdir, object->reduction, object->filter, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->solang, object->fault); 3648 3681 } 3649 3682 … … 3763 3796 return false; 3764 3797 } 3798 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, object->reduction)) { 3799 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 3800 psFree(md); 3801 return false; 3802 } 3765 3803 if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, object->filter)) { 3766 3804 psError(PS_ERR_UNKNOWN, false, "failed to add item filter"); … … 3922 3960 return false; 3923 3961 } 3962 char* reduction = psMetadataLookupPtr(&status, md, "reduction"); 3963 if (!status) { 3964 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item reduction"); 3965 return false; 3966 } 3924 3967 char* filter = psMetadataLookupPtr(&status, md, "filter"); 3925 3968 if (!status) { … … 4028 4071 } 4029 4072 4030 return rawExpRowAlloc(exp_id, exp_name, camera, telescope, dateobs, exp_tag, exp_type, filelevel, workdir, filter, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, user_1, user_2, user_3, user_4, user_5, object, solang, fault);4073 return rawExpRowAlloc(exp_id, exp_name, camera, telescope, dateobs, exp_tag, exp_type, filelevel, workdir, reduction, filter, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, user_1, user_2, user_3, user_4, user_5, object, solang, fault); 4031 4074 } 4032 4075 psArray *rawExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 5349 5392 static void chipRunRowFree(chipRunRow *object); 5350 5393 5351 chipRunRow *chipRunRowAlloc(psS64 chip_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *reduction, const char *expgroup, const char *dvodb)5394 chipRunRow *chipRunRowAlloc(psS64 chip_id, psS64 exp_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *reduction, const char *expgroup, const char *dvodb) 5352 5395 { 5353 5396 chipRunRow *_object; … … 5357 5400 5358 5401 _object->chip_id = chip_id; 5402 _object->exp_id = exp_id; 5359 5403 _object->state = psStringCopy(state); 5360 5404 _object->workdir = psStringCopy(workdir); … … 5387 5431 return false; 5388 5432 } 5389 if (!psMetadataAdd(md, PS_LIST_TAIL, "state", PS_DATA_STRING, "key", "64")) { 5433 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, "Key INDEX(chip_id, exp_id) fkey (exp_id) ref rawExp(exp_id)", 64)) { 5434 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 5435 psFree(md); 5436 return false; 5437 } 5438 if (!psMetadataAdd(md, PS_LIST_TAIL, "state", PS_DATA_STRING, "Key", "64")) { 5390 5439 psError(PS_ERR_UNKNOWN, false, "failed to add item state"); 5391 5440 psFree(md); … … 5397 5446 return false; 5398 5447 } 5399 if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir_state", PS_DATA_STRING, " key", "64")) {5448 if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir_state", PS_DATA_STRING, "Key", "64")) { 5400 5449 psError(PS_ERR_UNKNOWN, false, "failed to add item workdir_state"); 5401 5450 psFree(md); 5402 5451 return false; 5403 5452 } 5404 if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, " key", "64")) {5453 if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, "Key", "64")) { 5405 5454 psError(PS_ERR_UNKNOWN, false, "failed to add item label"); 5406 5455 psFree(md); … … 5412 5461 return false; 5413 5462 } 5414 if (!psMetadataAdd(md, PS_LIST_TAIL, "expgroup", PS_DATA_STRING, " key", "64")) {5463 if (!psMetadataAdd(md, PS_LIST_TAIL, "expgroup", PS_DATA_STRING, "Key", "64")) { 5415 5464 psError(PS_ERR_UNKNOWN, false, "failed to add item expgroup"); 5416 5465 psFree(md); … … 5435 5484 } 5436 5485 5437 bool chipRunInsert(psDB * dbh, psS64 chip_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *reduction, const char *expgroup, const char *dvodb)5486 bool chipRunInsert(psDB * dbh, psS64 chip_id, psS64 exp_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *reduction, const char *expgroup, const char *dvodb) 5438 5487 { 5439 5488 psMetadata *md = psMetadataAlloc(); 5440 5489 if (!psMetadataAdd(md, PS_LIST_TAIL, "chip_id", PS_DATA_S64, NULL, chip_id)) { 5441 5490 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 5491 psFree(md); 5492 return false; 5493 } 5494 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, NULL, exp_id)) { 5495 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 5442 5496 psFree(md); 5443 5497 return false; … … 5501 5555 bool chipRunInsertObject(psDB *dbh, chipRunRow *object) 5502 5556 { 5503 return chipRunInsert(dbh, object->chip_id, object-> state, object->workdir, object->workdir_state, object->label, object->reduction, object->expgroup, object->dvodb);5557 return chipRunInsert(dbh, object->chip_id, object->exp_id, object->state, object->workdir, object->workdir_state, object->label, object->reduction, object->expgroup, object->dvodb); 5504 5558 } 5505 5559 … … 5579 5633 return false; 5580 5634 } 5635 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, NULL, object->exp_id)) { 5636 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 5637 psFree(md); 5638 return false; 5639 } 5581 5640 if (!psMetadataAdd(md, PS_LIST_TAIL, "state", PS_DATA_STRING, NULL, object->state)) { 5582 5641 psError(PS_ERR_UNKNOWN, false, "failed to add item state"); … … 5628 5687 return false; 5629 5688 } 5689 psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id"); 5690 if (!status) { 5691 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item exp_id"); 5692 return false; 5693 } 5630 5694 char* state = psMetadataLookupPtr(&status, md, "state"); 5631 5695 if (!status) { … … 5664 5728 } 5665 5729 5666 return chipRunRowAlloc(chip_id, state, workdir, workdir_state, label, reduction, expgroup, dvodb);5730 return chipRunRowAlloc(chip_id, exp_id, state, workdir, workdir_state, label, reduction, expgroup, dvodb); 5667 5731 } 5668 5732 psArray *chipRunSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 5764 5828 5765 5829 psMetadata *md = chipRunMetadataFromObject(object); 5766 5767 if (!ippdbPrintMetadataRaw(stream, md, mdcf)) {5768 psError(PS_ERR_UNKNOWN, false, "failed to print metadata");5769 psFree(md);5770 }5771 5772 psFree(md);5773 5774 return true;5775 }5776 static void chipInputImfileRowFree(chipInputImfileRow *object);5777 5778 chipInputImfileRow *chipInputImfileRowAlloc(psS64 chip_id, psS64 exp_id, const char *class_id)5779 {5780 chipInputImfileRow *_object;5781 5782 _object = psAlloc(sizeof(chipInputImfileRow));5783 psMemSetDeallocator(_object, (psFreeFunc)chipInputImfileRowFree);5784 5785 _object->chip_id = chip_id;5786 _object->exp_id = exp_id;5787 _object->class_id = psStringCopy(class_id);5788 5789 return _object;5790 }5791 5792 static void chipInputImfileRowFree(chipInputImfileRow *object)5793 {5794 psFree(object->class_id);5795 }5796 5797 bool chipInputImfileCreateTable(psDB *dbh)5798 {5799 psMetadata *md = psMetadataAlloc();5800 if (!psMetadataAdd(md, PS_LIST_TAIL, "chip_id", PS_DATA_S64, "Primary Key fkey (chip_id) ref chipRun(chip_id)", 0)) {5801 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");5802 psFree(md);5803 return false;5804 }5805 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, "Primary Key fkey (exp_id, class_id) ref rawImfile (exp_id, class_id)", 64)) {5806 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");5807 psFree(md);5808 return false;5809 }5810 if (!psMetadataAdd(md, PS_LIST_TAIL, "class_id", PS_DATA_STRING, "Primary Key", "64")) {5811 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");5812 psFree(md);5813 return false;5814 }5815 5816 bool status = psDBCreateTable(dbh, CHIPINPUTIMFILE_TABLE_NAME, md);5817 5818 psFree(md);5819 5820 return status;5821 }5822 5823 bool chipInputImfileDropTable(psDB *dbh)5824 {5825 return psDBDropTable(dbh, CHIPINPUTIMFILE_TABLE_NAME);5826 }5827 5828 bool chipInputImfileInsert(psDB * dbh, psS64 chip_id, psS64 exp_id, const char *class_id)5829 {5830 psMetadata *md = psMetadataAlloc();5831 if (!psMetadataAdd(md, PS_LIST_TAIL, "chip_id", PS_DATA_S64, NULL, chip_id)) {5832 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");5833 psFree(md);5834 return false;5835 }5836 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, NULL, exp_id)) {5837 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");5838 psFree(md);5839 return false;5840 }5841 if (!psMetadataAdd(md, PS_LIST_TAIL, "class_id", PS_DATA_STRING, NULL, class_id)) {5842 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");5843 psFree(md);5844 return false;5845 }5846 5847 bool status = psDBInsertOneRow(dbh, CHIPINPUTIMFILE_TABLE_NAME, md);5848 psFree(md);5849 5850 return status;5851 }5852 5853 long long chipInputImfileDelete(psDB *dbh, const psMetadata *where, unsigned long long limit)5854 {5855 long long deleted = 0;5856 5857 long long count = psDBDeleteRows(dbh, CHIPINPUTIMFILE_TABLE_NAME, where, limit);5858 if (count < 0) {5859 psError(PS_ERR_UNKNOWN, true, "failed to delete row from chipInputImfile");5860 return count;5861 5862 deleted += count;5863 }5864 5865 return deleted;5866 }5867 bool chipInputImfileInsertObject(psDB *dbh, chipInputImfileRow *object)5868 {5869 return chipInputImfileInsert(dbh, object->chip_id, object->exp_id, object->class_id);5870 }5871 5872 bool chipInputImfileInsertObjects(psDB *dbh, psArray *objects)5873 {5874 for (long i = 0; i < psArrayLength(objects); i++) {5875 if (!chipInputImfileInsertObject(dbh, objects->data[i])) {5876 return false;5877 }5878 }5879 5880 return true;5881 }5882 5883 bool chipInputImfileInsertFits(psDB *dbh, const psFits *fits)5884 {5885 psArray *rowSet;5886 5887 // move to (the first?) extension named CHIPINPUTIMFILE_TABLE_NAME5888 if (!psFitsMoveExtName(fits, CHIPINPUTIMFILE_TABLE_NAME)) {5889 psError(PS_ERR_UNKNOWN, true, "failed to find FITS extension %s", CHIPINPUTIMFILE_TABLE_NAME);5890 return false;5891 }5892 5893 // check HDU type5894 if (psFitsGetExtType(fits) != PS_FITS_TYPE_BINARY_TABLE) {5895 psError(PS_ERR_UNKNOWN, true, "FITS HDU type is not PS_FITS_TYPE_BINARY_TABLE");5896 return false;5897 }5898 5899 // read fits table5900 rowSet = psFitsReadTable(fits);5901 if (!rowSet) {5902 psError(PS_ERR_UNKNOWN, true, "FITS read error or FITS table is empty");5903 psFree(rowSet);5904 return false;5905 }5906 5907 if (!psDBInsertRows(dbh, CHIPINPUTIMFILE_TABLE_NAME, rowSet)) {5908 psError(PS_ERR_UNKNOWN, false, "databse insert failed");5909 psFree(rowSet);5910 return false;5911 }5912 5913 psFree(rowSet);5914 5915 return true;5916 }5917 5918 bool chipInputImfileSelectRowsFits(psDB *dbh, psFits *fits, const psMetadata *where, unsigned long long limit)5919 {5920 psArray *rowSet;5921 5922 rowSet = psDBSelectRows(dbh, CHIPINPUTIMFILE_TABLE_NAME, where, limit);5923 if (!rowSet) {5924 return false;5925 }5926 5927 // output to fits5928 if (!psFitsWriteTable(fits, NULL, rowSet, CHIPINPUTIMFILE_TABLE_NAME)) {5929 psError(PS_ERR_UNKNOWN, false, "FITS table write failed");5930 psFree(rowSet);5931 return false;5932 }5933 5934 psFree(rowSet);5935 5936 return true;5937 }5938 5939 psMetadata *chipInputImfileMetadataFromObject(const chipInputImfileRow *object)5940 {5941 psMetadata *md = psMetadataAlloc();5942 if (!psMetadataAdd(md, PS_LIST_TAIL, "chip_id", PS_DATA_S64, NULL, object->chip_id)) {5943 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");5944 psFree(md);5945 return false;5946 }5947 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, NULL, object->exp_id)) {5948 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");5949 psFree(md);5950 return false;5951 }5952 if (!psMetadataAdd(md, PS_LIST_TAIL, "class_id", PS_DATA_STRING, NULL, object->class_id)) {5953 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");5954 psFree(md);5955 return false;5956 }5957 5958 5959 return md;5960 }5961 5962 chipInputImfileRow *chipInputImfileObjectFromMetadata(psMetadata *md)5963 {5964 5965 bool status = false;5966 psS64 chip_id = psMetadataLookupS64(&status, md, "chip_id");5967 if (!status) {5968 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item chip_id");5969 return false;5970 }5971 psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id");5972 if (!status) {5973 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item exp_id");5974 return false;5975 }5976 char* class_id = psMetadataLookupPtr(&status, md, "class_id");5977 if (!status) {5978 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item class_id");5979 return false;5980 }5981 5982 return chipInputImfileRowAlloc(chip_id, exp_id, class_id);5983 }5984 psArray *chipInputImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)5985 {5986 psArray *rowSet;5987 psArray *returnSet;5988 psU64 i;5989 5990 rowSet = psDBSelectRows(dbh, CHIPINPUTIMFILE_TABLE_NAME, where, limit);5991 if (!rowSet) {5992 return NULL;5993 }5994 5995 // convert psMetadata rows to row objects5996 5997 returnSet = psArrayAllocEmpty(rowSet->n);5998 5999 for (i = 0; i < rowSet->n; i++) {6000 chipInputImfileRow *object = chipInputImfileObjectFromMetadata(rowSet->data[i]);6001 psArrayAdd(returnSet, 0, object);6002 psFree(object);6003 }6004 6005 psFree(rowSet);6006 6007 return returnSet;6008 }6009 bool chipInputImfileDeleteObject(psDB *dbh, const chipInputImfileRow *object)6010 {6011 psMetadata *where = chipInputImfileMetadataFromObject(object);6012 long long count = psDBDeleteRows(dbh, CHIPINPUTIMFILE_TABLE_NAME, where, 0);6013 psFree(where);6014 if (count < 0) {6015 psError(PS_ERR_UNKNOWN, true, "failed to delete row from chipInputImfile");6016 return false;6017 }6018 if (count > 1) {6019 // XXX should this be a psAbort() instead? It is possible that6020 // having an object match multiple rows was by design.6021 psError(PS_ERR_UNKNOWN, true, "chipInputImfileRow object matched more then one row. Check your database schema");6022 return false;6023 }6024 6025 return true;6026 }6027 long long chipInputImfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)6028 {6029 long long deleted = 0;6030 6031 for (long long i = 0; i < objects->n; i++) {6032 chipInputImfileRow *object = objects->data[i];6033 psMetadata *where = chipInputImfileMetadataFromObject(object);6034 long long count = psDBDeleteRows(dbh, CHIPINPUTIMFILE_TABLE_NAME, where, limit);6035 psFree(where);6036 if (count < 0) {6037 psError(PS_ERR_UNKNOWN, true, "failed to delete row from chipInputImfile");6038 return count;6039 }6040 6041 deleted += count;6042 }6043 6044 return deleted;6045 }6046 bool chipInputImfilePrintObjects(FILE *stream, psArray *objects, bool mdcf)6047 {6048 PS_ASSERT_PTR_NON_NULL(objects, false);6049 6050 psMetadata *output = psMetadataAlloc();6051 for (long i = 0; i < psArrayLength(objects); i++) {6052 psMetadata *md = chipInputImfileMetadataFromObject(objects->data[i]);6053 if (!psMetadataAddMetadata(6054 output,6055 PS_LIST_TAIL,6056 CHIPINPUTIMFILE_TABLE_NAME,6057 PS_META_DUPLICATE_OK,6058 NULL,6059 md6060 )) {6061 psError(PS_ERR_UNKNOWN, false, "failed to add metadata");6062 psFree(md);6063 psFree(output);6064 return false;6065 }6066 psFree(md);6067 }6068 6069 if (!ippdbPrintMetadataRaw(stream, output, mdcf)) {6070 psError(PS_ERR_UNKNOWN, false, "failed to print metadata");6071 psFree(output);6072 }6073 psFree(output);6074 6075 return true;6076 }6077 bool chipInputImfilePrintObject(FILE *stream, chipInputImfileRow *object, bool mdcf)6078 {6079 PS_ASSERT_PTR_NON_NULL(object, false);6080 6081 psMetadata *md = chipInputImfileMetadataFromObject(object);6082 5830 6083 5831 if (!ippdbPrintMetadataRaw(stream, md, mdcf)) { … … 6137 5885 { 6138 5886 psMetadata *md = psMetadataAlloc(); 6139 if (!psMetadataAdd(md, PS_LIST_TAIL, "chip_id", PS_DATA_S64, "Primary Key fkey (chip_id, exp_id , class_id) ref chipInputImfile(chip_id, exp_id, class_id)", 0)) {5887 if (!psMetadataAdd(md, PS_LIST_TAIL, "chip_id", PS_DATA_S64, "Primary Key fkey (chip_id, exp_id) ref chipRun(chip_id, exp_id)", 0)) { 6140 5888 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 6141 5889 psFree(md); 6142 5890 return false; 6143 5891 } 6144 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, "Primary Key ", 64)) {5892 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, "Primary Key fkey (exp_id, class_id) ref rawImfile(exp_id, class_id)", 64)) { 6145 5893 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 6146 5894 psFree(md); … … 7164 6912 return false; 7165 6913 } 7166 if (!psMetadataAdd(md, PS_LIST_TAIL, "chip_id", PS_DATA_S64, " Primary Keyfkey(chip_id) ref chipRun(chip_id)", 0)) {6914 if (!psMetadataAdd(md, PS_LIST_TAIL, "chip_id", PS_DATA_S64, "Key INDEX(cam_id, chip_id) fkey(chip_id) ref chipRun(chip_id)", 0)) { 7167 6915 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 7168 6916 psFree(md); … … 9558 9306 static void warpSkyfileRowFree(warpSkyfileRow *object); 9559 9307 9560 warpSkyfileRow *warpSkyfileRowAlloc(psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev )9308 warpSkyfileRow *warpSkyfileRowAlloc(psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psS16 fault) 9561 9309 { 9562 9310 warpSkyfileRow *_object; … … 9572 9320 _object->bg = bg; 9573 9321 _object->bg_stdev = bg_stdev; 9322 _object->fault = fault; 9574 9323 9575 9324 return _object; … … 9622 9371 return false; 9623 9372 } 9373 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "Key", 0)) { 9374 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 9375 psFree(md); 9376 return false; 9377 } 9624 9378 9625 9379 bool status = psDBCreateTable(dbh, WARPSKYFILE_TABLE_NAME, md); … … 9635 9389 } 9636 9390 9637 bool warpSkyfileInsert(psDB * dbh, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev )9391 bool warpSkyfileInsert(psDB * dbh, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psS16 fault) 9638 9392 { 9639 9393 psMetadata *md = psMetadataAlloc(); … … 9670 9424 if (!psMetadataAdd(md, PS_LIST_TAIL, "bg_stdev", PS_DATA_F64, NULL, bg_stdev)) { 9671 9425 psError(PS_ERR_UNKNOWN, false, "failed to add item bg_stdev"); 9426 psFree(md); 9427 return false; 9428 } 9429 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 9430 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 9672 9431 psFree(md); 9673 9432 return false; … … 9696 9455 bool warpSkyfileInsertObject(psDB *dbh, warpSkyfileRow *object) 9697 9456 { 9698 return warpSkyfileInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->uri, object->path_base, object->bg, object->bg_stdev );9457 return warpSkyfileInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->fault); 9699 9458 } 9700 9459 … … 9804 9563 return false; 9805 9564 } 9565 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 9566 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 9567 psFree(md); 9568 return false; 9569 } 9806 9570 9807 9571 … … 9848 9612 return false; 9849 9613 } 9850 9851 return warpSkyfileRowAlloc(warp_id, skycell_id, tess_id, uri, path_base, bg, bg_stdev); 9614 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 9615 if (!status) { 9616 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 9617 return false; 9618 } 9619 9620 return warpSkyfileRowAlloc(warp_id, skycell_id, tess_id, uri, path_base, bg, bg_stdev, fault); 9852 9621 } 9853 9622 psArray *warpSkyfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 10747 10516 static void diffSkyfileRowFree(diffSkyfileRow *object); 10748 10517 10749 diffSkyfileRow *diffSkyfileRowAlloc(psS64 diff_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev )10518 diffSkyfileRow *diffSkyfileRowAlloc(psS64 diff_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psS16 fault) 10750 10519 { 10751 10520 diffSkyfileRow *_object; … … 10759 10528 _object->bg = bg; 10760 10529 _object->bg_stdev = bg_stdev; 10530 _object->fault = fault; 10761 10531 10762 10532 return _object; … … 10797 10567 return false; 10798 10568 } 10569 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "Key", 0)) { 10570 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 10571 psFree(md); 10572 return false; 10573 } 10799 10574 10800 10575 bool status = psDBCreateTable(dbh, DIFFSKYFILE_TABLE_NAME, md); … … 10810 10585 } 10811 10586 10812 bool diffSkyfileInsert(psDB * dbh, psS64 diff_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev )10587 bool diffSkyfileInsert(psDB * dbh, psS64 diff_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psS16 fault) 10813 10588 { 10814 10589 psMetadata *md = psMetadataAlloc(); … … 10835 10610 if (!psMetadataAdd(md, PS_LIST_TAIL, "bg_stdev", PS_DATA_F64, NULL, bg_stdev)) { 10836 10611 psError(PS_ERR_UNKNOWN, false, "failed to add item bg_stdev"); 10612 psFree(md); 10613 return false; 10614 } 10615 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 10616 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 10837 10617 psFree(md); 10838 10618 return false; … … 10861 10641 bool diffSkyfileInsertObject(psDB *dbh, diffSkyfileRow *object) 10862 10642 { 10863 return diffSkyfileInsert(dbh, object->diff_id, object->uri, object->path_base, object->bg, object->bg_stdev );10643 return diffSkyfileInsert(dbh, object->diff_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->fault); 10864 10644 } 10865 10645 … … 10959 10739 return false; 10960 10740 } 10741 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 10742 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 10743 psFree(md); 10744 return false; 10745 } 10961 10746 10962 10747 … … 10993 10778 return false; 10994 10779 } 10995 10996 return diffSkyfileRowAlloc(diff_id, uri, path_base, bg, bg_stdev); 10780 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 10781 if (!status) { 10782 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 10783 return false; 10784 } 10785 10786 return diffSkyfileRowAlloc(diff_id, uri, path_base, bg, bg_stdev, fault); 10997 10787 } 10998 10788 psArray *diffSkyfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 11805 11595 static void stackSumSkyfileRowFree(stackSumSkyfileRow *object); 11806 11596 11807 stackSumSkyfileRow *stackSumSkyfileRowAlloc(psS64 stack_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev )11597 stackSumSkyfileRow *stackSumSkyfileRowAlloc(psS64 stack_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psS16 fault) 11808 11598 { 11809 11599 stackSumSkyfileRow *_object; … … 11817 11607 _object->bg = bg; 11818 11608 _object->bg_stdev = bg_stdev; 11609 _object->fault = fault; 11819 11610 11820 11611 return _object; … … 11855 11646 return false; 11856 11647 } 11648 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "Key", 0)) { 11649 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 11650 psFree(md); 11651 return false; 11652 } 11857 11653 11858 11654 bool status = psDBCreateTable(dbh, STACKSUMSKYFILE_TABLE_NAME, md); … … 11868 11664 } 11869 11665 11870 bool stackSumSkyfileInsert(psDB * dbh, psS64 stack_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev )11666 bool stackSumSkyfileInsert(psDB * dbh, psS64 stack_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psS16 fault) 11871 11667 { 11872 11668 psMetadata *md = psMetadataAlloc(); … … 11893 11689 if (!psMetadataAdd(md, PS_LIST_TAIL, "bg_stdev", PS_DATA_F64, NULL, bg_stdev)) { 11894 11690 psError(PS_ERR_UNKNOWN, false, "failed to add item bg_stdev"); 11691 psFree(md); 11692 return false; 11693 } 11694 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 11695 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 11895 11696 psFree(md); 11896 11697 return false; … … 11919 11720 bool stackSumSkyfileInsertObject(psDB *dbh, stackSumSkyfileRow *object) 11920 11721 { 11921 return stackSumSkyfileInsert(dbh, object->stack_id, object->uri, object->path_base, object->bg, object->bg_stdev );11722 return stackSumSkyfileInsert(dbh, object->stack_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->fault); 11922 11723 } 11923 11724 … … 12017 11818 return false; 12018 11819 } 11820 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 11821 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 11822 psFree(md); 11823 return false; 11824 } 12019 11825 12020 11826 … … 12051 11857 return false; 12052 11858 } 12053 12054 return stackSumSkyfileRowAlloc(stack_id, uri, path_base, bg, bg_stdev); 11859 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 11860 if (!status) { 11861 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 11862 return false; 11863 } 11864 11865 return stackSumSkyfileRowAlloc(stack_id, uri, path_base, bg, bg_stdev, fault); 12055 11866 } 12056 11867 psArray *stackSumSkyfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 13063 12874 { 13064 12875 psMetadata *md = psMetadataAlloc(); 13065 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key ", 0)) {12876 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key INDEX(det_id, exp_id) fkey (det_id) ref detRun(det_id)", 0)) { 13066 12877 psError(PS_ERR_UNKNOWN, false, "failed to add item det_id"); 13067 12878 psFree(md); 13068 12879 return false; 13069 12880 } 13070 if (!psMetadataAdd(md, PS_LIST_TAIL, "iteration", PS_DATA_S32, "Primary Key ", 0)) {12881 if (!psMetadataAdd(md, PS_LIST_TAIL, "iteration", PS_DATA_S32, "Primary Key INDEX(det_id, iteration)", 0)) { 13071 12882 psError(PS_ERR_UNKNOWN, false, "failed to add item iteration"); 13072 12883 psFree(md); 13073 12884 return false; 13074 12885 } 13075 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, "Primary Key ", 64)) {12886 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, "Primary Key fkey (exp_id) ref rawExp(exp_id)", 64)) { 13076 12887 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 13077 12888 psFree(md); … … 13417 13228 { 13418 13229 psMetadata *md = psMetadataAlloc(); 13419 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key ", 0)) {13230 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key fkey (det_id, exp_id) ref detInputExp(det_id, exp_id)", 0)) { 13420 13231 psError(PS_ERR_UNKNOWN, false, "failed to add item det_id"); 13421 13232 psFree(md); 13422 13233 return false; 13423 13234 } 13424 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, "Primary Key ", 64)) {13235 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, "Primary Key fkey (exp_id, class_id) ref rawImfile(exp_id, class_id)", 64)) { 13425 13236 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 13426 13237 psFree(md); 13427 13238 return false; 13428 13239 } 13429 if (!psMetadataAdd(md, PS_LIST_TAIL, "class_id", PS_DATA_STRING, "Primary Key ", "64")) {13240 if (!psMetadataAdd(md, PS_LIST_TAIL, "class_id", PS_DATA_STRING, "Primary Key INDEX(det_id, class_id)", "64")) { 13430 13241 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id"); 13431 13242 psFree(md); … … 14047 13858 { 14048 13859 psMetadata *md = psMetadataAlloc(); 14049 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key ", 0)) {13860 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key fkey(det_id, exp_id) ref detInputExp(det_id, exp_id)", 0)) { 14050 13861 psError(PS_ERR_UNKNOWN, false, "failed to add item det_id"); 14051 13862 psFree(md); … … 14636 14447 { 14637 14448 psMetadata *md = psMetadataAlloc(); 14638 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key ", 0)) {14449 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key fkey(det_id, iteration) ref detInputExp(det_id, iteration)", 0)) { 14639 14450 psError(PS_ERR_UNKNOWN, false, "failed to add item det_id"); 14640 14451 psFree(md); 14641 14452 return false; 14642 14453 } 14643 if (!psMetadataAdd(md, PS_LIST_TAIL, "iteration", PS_DATA_S32, "Primary Key ", 0)) {14454 if (!psMetadataAdd(md, PS_LIST_TAIL, "iteration", PS_DATA_S32, "Primary Key fkey(det_id, class_id) ref detProcessedImfile(det_id, class_id)", 0)) { 14644 14455 psError(PS_ERR_UNKNOWN, false, "failed to add item iteration"); 14645 14456 psFree(md); … … 15174 14985 { 15175 14986 psMetadata *md = psMetadataAlloc(); 15176 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key ", 0)) {14987 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key fkey(det_id, iteration, class_id) ref detStackedImfile(det_id, iteration, class_id)", 0)) { 15177 14988 psError(PS_ERR_UNKNOWN, false, "failed to add item det_id"); 15178 14989 psFree(md); … … 15543 15354 { 15544 15355 psMetadata *md = psMetadataAlloc(); 15545 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key ", 0)) {15356 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key INDEX(det_id, iteration) fkey(det_id) ref detInputExp(det_id)", 0)) { 15546 15357 psError(PS_ERR_UNKNOWN, false, "failed to add item det_id"); 15547 15358 psFree(md); … … 16090 15901 { 16091 15902 psMetadata *md = psMetadataAlloc(); 16092 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key ", 0)) {15903 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key fkey(det_id, iteration) ref detNormalizedImfile(det_id, iteration)", 0)) { 16093 15904 psError(PS_ERR_UNKNOWN, false, "failed to add item det_id"); 16094 15905 psFree(md); … … 17938 17749 { 17939 17750 psMetadata *md = psMetadataAlloc(); 17940 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key ", 0)) {17751 if (!psMetadataAdd(md, PS_LIST_TAIL, "det_id", PS_DATA_S64, "Primary Key fkey(det_id, iteration) ref detInputExp(det_id, iteration)", 0)) { 17941 17752 psError(PS_ERR_UNKNOWN, false, "failed to add item det_id"); 17942 17753 psFree(md);
Note:
See TracChangeset
for help on using the changeset viewer.
