35
35
g_return_if_fail (self != NULL);
36
36
g_return_if_fail (query_result != NULL);
38
SQLHeavyQuery* _tmp0_ = NULL;
39
const gchar* _tmp1_ = NULL;
43
SQLHeavyQueryResult* _tmp5_ = NULL;
44
SQLHeavyQueryResult* _tmp6_;
38
SQLHeavyQuery* _tmp0_;
39
_tmp0_ = self->priv->query;
45
40
g_static_rec_mutex_lock (&self->priv->__lock_query);
46
_tmp0_ = sql_heavy_query_result_get_query (query_result);
47
_tmp1_ = sql_heavy_query_get_sql (_tmp0_);
48
sql_heavy_query_set_string (self->priv->query, ":sql", _tmp1_, &_inner_error_);
49
if (_inner_error_ != NULL) {
50
if (_inner_error_->domain == SQL_HEAVY_ERROR) {
51
goto __catch18_sql_heavy_error;
53
g_static_rec_mutex_unlock (&self->priv->__lock_query);
54
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
55
g_clear_error (&_inner_error_);
58
_tmp2_ = sql_heavy_query_result_get_execution_time (query_result);
59
sql_heavy_query_set_double (self->priv->query, ":clock", _tmp2_, &_inner_error_);
60
if (_inner_error_ != NULL) {
61
if (_inner_error_->domain == SQL_HEAVY_ERROR) {
62
goto __catch18_sql_heavy_error;
64
g_static_rec_mutex_unlock (&self->priv->__lock_query);
65
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
66
g_clear_error (&_inner_error_);
69
_tmp3_ = sql_heavy_query_result_get_full_scan_steps (query_result);
70
sql_heavy_query_set_int64 (self->priv->query, ":fullscan_step", (gint64) _tmp3_, &_inner_error_);
71
if (_inner_error_ != NULL) {
72
if (_inner_error_->domain == SQL_HEAVY_ERROR) {
73
goto __catch18_sql_heavy_error;
75
g_static_rec_mutex_unlock (&self->priv->__lock_query);
76
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
77
g_clear_error (&_inner_error_);
80
_tmp4_ = sql_heavy_query_result_get_sort_operations (query_result);
81
sql_heavy_query_set_int64 (self->priv->query, ":sort", (gint64) _tmp4_, &_inner_error_);
82
if (_inner_error_ != NULL) {
83
if (_inner_error_->domain == SQL_HEAVY_ERROR) {
84
goto __catch18_sql_heavy_error;
86
g_static_rec_mutex_unlock (&self->priv->__lock_query);
87
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
88
g_clear_error (&_inner_error_);
91
_tmp5_ = sql_heavy_query_execute (self->priv->query, NULL, &_inner_error_, NULL);
93
_g_object_unref0 (_tmp6_);
94
if (_inner_error_ != NULL) {
95
if (_inner_error_->domain == SQL_HEAVY_ERROR) {
96
goto __catch18_sql_heavy_error;
98
g_static_rec_mutex_unlock (&self->priv->__lock_query);
99
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
100
g_clear_error (&_inner_error_);
104
__catch18_sql_heavy_error:
108
_inner_error_ = NULL;
109
g_warning ("sqlheavy-profiling-database.vala:29: Unable to insert entry into profi" \
110
"ling database: %s", e->message);
114
if (_inner_error_ != NULL) {
115
g_static_rec_mutex_unlock (&self->priv->__lock_query);
116
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
117
g_clear_error (&_inner_error_);
43
SQLHeavyQuery* _tmp1_;
44
SQLHeavyQueryResult* _tmp2_;
45
SQLHeavyQuery* _tmp3_;
46
SQLHeavyQuery* _tmp4_;
49
SQLHeavyQuery* _tmp8_;
50
SQLHeavyQueryResult* _tmp9_;
53
SQLHeavyQuery* _tmp13_;
54
SQLHeavyQueryResult* _tmp14_;
57
SQLHeavyQuery* _tmp18_;
58
SQLHeavyQueryResult* _tmp19_;
61
SQLHeavyQuery* _tmp23_;
62
SQLHeavyQueryResult* _tmp24_ = NULL;
63
SQLHeavyQueryResult* _tmp25_;
64
_tmp1_ = self->priv->query;
65
_tmp2_ = query_result;
66
_tmp3_ = sql_heavy_query_result_get_query (_tmp2_);
68
_tmp5_ = sql_heavy_query_get_sql (_tmp4_);
70
sql_heavy_query_set_string (_tmp1_, ":sql", _tmp6_, &_inner_error_);
71
if (_inner_error_ != NULL) {
72
if (_inner_error_->domain == SQL_HEAVY_ERROR) {
73
goto __catch18_sql_heavy_error;
76
SQLHeavyQuery* _tmp7_;
77
_tmp7_ = self->priv->query;
78
g_static_rec_mutex_unlock (&self->priv->__lock_query);
80
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
81
g_clear_error (&_inner_error_);
84
_tmp8_ = self->priv->query;
85
_tmp9_ = query_result;
86
_tmp10_ = sql_heavy_query_result_get_execution_time (_tmp9_);
88
sql_heavy_query_set_double (_tmp8_, ":clock", _tmp11_, &_inner_error_);
89
if (_inner_error_ != NULL) {
90
if (_inner_error_->domain == SQL_HEAVY_ERROR) {
91
goto __catch18_sql_heavy_error;
94
SQLHeavyQuery* _tmp12_;
95
_tmp12_ = self->priv->query;
96
g_static_rec_mutex_unlock (&self->priv->__lock_query);
98
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
99
g_clear_error (&_inner_error_);
102
_tmp13_ = self->priv->query;
103
_tmp14_ = query_result;
104
_tmp15_ = sql_heavy_query_result_get_full_scan_steps (_tmp14_);
106
sql_heavy_query_set_int64 (_tmp13_, ":fullscan_step", (gint64) _tmp16_, &_inner_error_);
107
if (_inner_error_ != NULL) {
108
if (_inner_error_->domain == SQL_HEAVY_ERROR) {
109
goto __catch18_sql_heavy_error;
112
SQLHeavyQuery* _tmp17_;
113
_tmp17_ = self->priv->query;
114
g_static_rec_mutex_unlock (&self->priv->__lock_query);
116
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
117
g_clear_error (&_inner_error_);
120
_tmp18_ = self->priv->query;
121
_tmp19_ = query_result;
122
_tmp20_ = sql_heavy_query_result_get_sort_operations (_tmp19_);
124
sql_heavy_query_set_int64 (_tmp18_, ":sort", (gint64) _tmp21_, &_inner_error_);
125
if (_inner_error_ != NULL) {
126
if (_inner_error_->domain == SQL_HEAVY_ERROR) {
127
goto __catch18_sql_heavy_error;
130
SQLHeavyQuery* _tmp22_;
131
_tmp22_ = self->priv->query;
132
g_static_rec_mutex_unlock (&self->priv->__lock_query);
134
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
135
g_clear_error (&_inner_error_);
138
_tmp23_ = self->priv->query;
139
_tmp24_ = sql_heavy_query_execute (_tmp23_, NULL, &_inner_error_, NULL);
141
_g_object_unref0 (_tmp25_);
142
if (_inner_error_ != NULL) {
143
if (_inner_error_->domain == SQL_HEAVY_ERROR) {
144
goto __catch18_sql_heavy_error;
147
SQLHeavyQuery* _tmp26_;
148
_tmp26_ = self->priv->query;
149
g_static_rec_mutex_unlock (&self->priv->__lock_query);
151
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
152
g_clear_error (&_inner_error_);
157
__catch18_sql_heavy_error:
161
const gchar* _tmp28_;
163
_inner_error_ = NULL;
165
_tmp28_ = _tmp27_->message;
166
g_warning ("sqlheavy-profiling-database.vala:29: Unable to insert entry into profi" \
167
"ling database: %s", _tmp28_);
171
if (_inner_error_ != NULL) {
173
SQLHeavyQuery* _tmp29_;
174
_tmp29_ = self->priv->query;
175
g_static_rec_mutex_unlock (&self->priv->__lock_query);
177
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
178
g_clear_error (&_inner_error_);
121
g_static_rec_mutex_unlock (&self->priv->__lock_query);
184
SQLHeavyQuery* _tmp30_;
185
_tmp30_ = self->priv->query;
186
g_static_rec_mutex_unlock (&self->priv->__lock_query);
122
188
if (_inner_error_ != NULL) {
123
189
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
124
190
g_clear_error (&_inner_error_);
170
245
GObjectClass * parent_class;
171
246
SQLHeavyProfilingDatabase * self;
172
SQLHeavyQuery* _tmp0_ = NULL;
173
SQLHeavyQuery* _tmp1_;
174
247
GError * _inner_error_ = NULL;
175
248
parent_class = G_OBJECT_CLASS (sql_heavy_profiling_database_parent_class);
176
249
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
177
250
self = SQL_HEAVY_PROFILING_DATABASE (obj);
178
251
sql_heavy_database_set_synchronous ((SQLHeavyDatabase*) self, SQL_HEAVY_SYNCHRONOUS_MODE_OFF);
179
252
sql_heavy_database_set_journal_mode ((SQLHeavyDatabase*) self, SQL_HEAVY_JOURNAL_MODE_OFF);
180
_tmp0_ = sql_heavy_query_new ((SQLHeavyQueryable*) self, "INSERT INTO `queries` (`sql`, `clock`, `fullscan_step`, `sort`) VALUES" \
254
SQLHeavyQuery* _tmp0_;
255
SQLHeavyQuery* _tmp1_;
256
SQLHeavyQuery* _tmp2_;
257
_tmp0_ = sql_heavy_query_new ((SQLHeavyQueryable*) self, "INSERT INTO `queries` (`sql`, `clock`, `fullscan_step`, `sort`) VALUES" \
181
258
" (:sql, :clock, :fullscan_step, :sort);", &_inner_error_);
183
if (_inner_error_ != NULL) {
184
if (_inner_error_->domain == SQL_HEAVY_ERROR) {
185
goto __catch19_sql_heavy_error;
260
if (_inner_error_ != NULL) {
261
if (_inner_error_->domain == SQL_HEAVY_ERROR) {
262
goto __catch19_sql_heavy_error;
264
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
265
g_clear_error (&_inner_error_);
187
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
188
g_clear_error (&_inner_error_);
267
_g_object_unref0 (self->priv->query);
268
self->priv->query = _tmp1_;
269
_tmp2_ = self->priv->query;
270
sql_heavy_query_set_auto_clear (_tmp2_, TRUE);
190
_g_object_unref0 (self->priv->query);
191
self->priv->query = _tmp1_;
192
sql_heavy_query_set_auto_clear (self->priv->query, TRUE);
193
272
goto __finally19;
194
273
__catch19_sql_heavy_error:
197
280
e = _inner_error_;
198
281
_inner_error_ = NULL;
283
_tmp4_ = _tmp3_->message;
285
_tmp6_ = _tmp5_->code;
199
286
g_warning ("sqlheavy-profiling-database.vala:43: Unable to insert profiling inform" \
200
"ation: %s (%d)", e->message, e->code);
287
"ation: %s (%d)", _tmp4_, _tmp6_);
201
288
_g_error_free0 (e);