Changeset 8420 for trunk/ippTools/src/dettool.c
- Timestamp:
- Aug 17, 2006, 6:36:29 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r8407 r8420 2663 2663 PS_ASSERT_PTR_NON_NULL(config, false); 2664 2664 2665 // no options are required... use the default where statement 2666 psArray *residImfiles = detResidImfileSelectRowObjects(config->dbh, 2667 config->where, 0); 2668 if (!residImfiles) { 2665 // select detResidImfile.* 2666 // by: 2667 // where det_id, iteration, exp_id is not in detResidExp; 2668 2669 psString query = psStringCopy( 2670 "SELECT" 2671 " detResidImfile.*" 2672 " FROM detResidImfile" 2673 " LEFT JOIN detResidExp" 2674 " USING(det_id, iteration, exp_id)" 2675 " WHERE" 2676 " detResidExp.det_id IS NULL" 2677 " AND detResidExp.iteration IS NULL" 2678 " AnD detResidExp.exp_id IS NULL" 2679 ); 2680 2681 if (config->where) { 2682 psString whereClaus = psDBGenerateWhereConditionSQL(config->where, "detResidImfile"); 2683 psStringAppend(&query, " AND %s", whereClaus); 2684 psFree(whereClaus); 2685 } 2686 2687 if (!p_psDBRunQuery(config->dbh, query)) { 2688 psError(PS_ERR_UNKNOWN, false, "database error"); 2689 psFree(query); 2690 return false; 2691 } 2692 psFree(query); 2693 2694 psArray *output = p_psDBFetchResult(config->dbh); 2695 if (!output) { 2696 // XXX check psError here 2669 2697 psError(PS_ERR_UNKNOWN, false, "no detResidImfile rows found"); 2670 2698 return false; … … 2677 2705 if (!status) { 2678 2706 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple"); 2707 psFree(output); 2679 2708 return false; 2680 2709 } … … 2682 2711 2683 2712 // negative simple so the default is true 2684 if (residImfiles->n) { 2685 if (!detResidImfilePrintObjects(stdout, residImfiles, !simple)) { 2686 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 2687 psFree(residImfiles); 2688 return false; 2689 } 2690 } 2691 2692 psFree(residImfiles); 2713 if (!ippdbPrintMetadatas(stdout, output, "rawResidImfile", !simple)) { 2714 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 2715 psFree(output); 2716 return false; 2717 } 2718 2719 psFree(output); 2693 2720 2694 2721 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
