27 #ifndef SQLSTATEMENTS_H 28 #define SQLSTATEMENTS_H 34 " SELECT column_name FROM information_schema.columns " 35 " WHERE table_catalog = '%s' " 36 " AND table_schema = 'public' " 43 " SELECT conf_value FROM sysconfig " 44 " WHERE variablename = 'FOSSologyURL';";
50 " SELECT job_upload_fk FROM job, jobqueue " 51 " WHERE jq_job_fk = job_pk " 58 " SELECT * FROM jobqueue " 59 " LEFT JOIN job ON jq_job_fk = job_pk" 60 " WHERE job.job_upload_fk = %d;";
66 " SELECT folder_name, folder_pk FROM folder " 67 " LEFT JOIN foldercontents ON folder_pk = foldercontents.parent_fk " 68 " LEFT JOIN job ON child_id = job_upload_fk " 69 " LEFT JOIN jobqueue ON jq_job_fk = job_pk " 77 " SELECT folder_name, folder_pk FROM folder " 78 " INNER JOIN foldercontents ON folder_pk=foldercontents.parent_fk " 79 " WHERE child_id = %d AND foldercontents_mode = 1;";
85 " SELECT upload_filename FROM upload " 86 " LEFT JOIN job ON upload_pk = job_upload_fk " 87 " LEFT JOIN jobqueue ON jq_job_fk = job_pk " 94 " SELECT upload_fk, uploadtree_pk FROM uploadtree " 95 " LEFT JOIN job ON upload_fk = job_upload_fk " 96 " LEFT JOIN jobqueue ON jq_job_fk = job_pk " 97 " WHERE parent IS NULL" 104 " SELECT user_name, user_email, email_notify FROM users, upload " 105 " WHERE user_pk = user_fk " 106 " AND upload_pk = %d;";
112 " SELECT user_name, user_email, email_notify FROM users, job, jobqueue " 113 " WHERE user_pk = job_user_fk AND job_pk = jq_job_fk " 121 " SELECT jobqueue.* FROM jobqueue INNER JOIN job ON job_pk = jq_job_fk " 122 " WHERE jq_starttime IS NULL AND jq_end_bits < 2 " 123 " AND NOT EXISTS(SELECT * FROM jobdepends, jobqueue jdep " 124 " WHERE jdep_jq_fk=jobqueue.jq_pk " 125 " AND jdep_jq_depends_fk=jdep.jq_pk" 126 " AND NOT(jdep.jq_endtime IS NOT NULL AND jdep.jq_end_bits < 2)) " 127 " ORDER BY job_priority DESC " 134 " SELECT user_pk, job_priority, job_group_fk as group_pk FROM users " 135 " LEFT JOIN job ON job_user_fk = user_pk " 136 " WHERE job_pk = '%s';";
143 " SET jq_starttime = now(), " 144 " jq_schedinfo ='%s.%d', " 145 " jq_endtext = 'Started' " 146 " WHERE jq_pk = '%d';";
153 " SET jq_endtime = now(), " 154 " jq_end_bits = jq_end_bits | 1, " 155 " jq_schedinfo = null, " 156 " jq_endtext = 'Completed' " 157 " WHERE jq_pk = '%d';";
164 " SET jq_endtext = 'Restarted', " 165 " jq_starttime = ( CASE " 166 " WHEN jq_starttime = CAST('9999-12-31' AS timestamp with time zone) " 168 " ELSE jq_starttime " 170 " WHERE jq_pk = '%d';";
177 " SET jq_endtime = now(), " 178 " jq_end_bits = jq_end_bits | 2, " 179 " jq_schedinfo = null, " 180 " jq_endtext = '%s' " 181 " WHERE jq_pk = '%d';";
188 " SET jq_itemsprocessed = %d " 189 " WHERE jq_pk = '%d';";
196 " SET jq_endtext = 'Paused', " 197 " jq_starttime = ( CASE " 198 " WHEN jq_starttime IS NULL " 199 " THEN CAST('9999-12-31' AS timestamp with time zone) " 200 " ELSE jq_starttime " 202 " WHERE jq_pk = '%d';";
209 " SET jq_log = '%s' " 210 " WHERE jq_pk = '%d';";
217 " SET job_priority = '%d' " 218 " WHERE job_pk IN ( " 219 " SELECT jq_job_fk FROM jobqueue " 220 " WHERE jq_pk = '%d');";
226 " SELECT * FROM jobqueue " 227 " WHERE jq_starttime IS NULL AND jq_end_bits < 2 " 228 " AND NOT EXISTS(SELECT * FROM jobdepends, jobqueue jdep " 229 " WHERE jdep_jq_fk=jobqueue.jq_pk " 230 " AND jdep_jq_depends_fk=jdep.jq_pk" 231 " AND NOT(jdep.jq_endtime IS NOT NULL AND jdep.jq_end_bits < 2))" 232 " AND jq_job_fk = (SELECT jq_job_fk FROM jobqueue queue WHERE queue.jq_pk = %d)";
238 " SELECT jq_pk, jq_end_bits FROM jobqueue " 239 " WHERE jq_job_fk = ( " 240 " SELECT jq_job_fk FROM jobqueue " 249 " SET jq_starttime=null, " 251 " jq_schedinfo=null " 252 " WHERE jq_endtime is NULL;";
258 " SELECT * FROM jobqueue " 259 " WHERE jq_job_fk = ( " 260 " SELECT jq_job_fk FROM jobqueue " 268 " SELECT conf_value, variablename FROM sysconfig " 269 " WHERE variablename LIKE 'SMTP%';";
const char * jobsql_email_job
const char * jobsql_started
const char * jobsql_paused
const char * jobsql_resetqueue
const char * upload_common
const char * jobsql_processed
const char * jobsql_complete
const char * jobsql_restart
const char * url_checkout
const char * jobsql_email
const char * basic_checkout
const char * jobsql_jobendbits
const char * jobsql_anyrunnable
const char * jobsql_priority
const char * parent_folder_name
const char * jobsql_information
const char * jobsql_failed
const char * check_scheduler_tables
const char * jobsql_jobinfo
const char * select_upload_fk