mysql_genius-core 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e540fed187eabd8f8ecef7f5b9950fd09b673bd9d1e5fb797b644a95e5d43ebf
|
|
4
|
+
data.tar.gz: '090e7af6a3a3eba97d85d5be5e231ce0e96bf8994f3d805e2f76c83534b993aa'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed888e3f62fc5de2ae4f22af58cdc6afcb8300d01ae5064811b9814c793148d7610b64faed03a13239e53d8c2ed9a13892c28e0bffb7c571071688373c5653ed
|
|
7
|
+
data.tar.gz: b4395e9d3c131e86f2abd74ca8cf5719f27c45f21e4d332a20691b869b60866ddbf958a7cefec65c029259df0ed7ee41ab33c5f7c6de39540da68312d4ce799f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.1
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **`QueryStats` gracefully handles missing `DIGEST` column** on older MySQL/MariaDB versions. Checks `information_schema.COLUMNS` before including it in the SELECT. Query detail links degrade to plain text when unavailable.
|
|
7
|
+
|
|
3
8
|
## 0.8.0
|
|
4
9
|
|
|
5
10
|
### Added
|
|
@@ -40,9 +40,10 @@ module MysqlGenius
|
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
def build_sql(order_clause, limit)
|
|
43
|
+
digest_col = digest_column_available? ? "DIGEST," : ""
|
|
43
44
|
<<~SQL
|
|
44
45
|
SELECT
|
|
45
|
-
|
|
46
|
+
#{digest_col}
|
|
46
47
|
DIGEST_TEXT,
|
|
47
48
|
COUNT_STAR AS calls,
|
|
48
49
|
ROUND(SUM_TIMER_WAIT / 1000000000, 1) AS total_time_ms,
|
|
@@ -99,6 +100,20 @@ module MysqlGenius
|
|
|
99
100
|
|
|
100
101
|
"#{string[0, max - 3]}..."
|
|
101
102
|
end
|
|
103
|
+
|
|
104
|
+
def digest_column_available?
|
|
105
|
+
return @digest_available if defined?(@digest_available)
|
|
106
|
+
|
|
107
|
+
result = @connection.exec_query(
|
|
108
|
+
"SELECT COLUMN_NAME FROM information_schema.COLUMNS " \
|
|
109
|
+
"WHERE TABLE_SCHEMA = 'performance_schema' " \
|
|
110
|
+
"AND TABLE_NAME = 'events_statements_summary_by_digest' " \
|
|
111
|
+
"AND COLUMN_NAME = 'DIGEST'",
|
|
112
|
+
)
|
|
113
|
+
@digest_available = !result.rows.empty?
|
|
114
|
+
rescue StandardError
|
|
115
|
+
@digest_available = false
|
|
116
|
+
end
|
|
102
117
|
end
|
|
103
118
|
end
|
|
104
119
|
end
|
|
@@ -424,7 +424,7 @@
|
|
|
424
424
|
show(el('dash-qstats-empty'));
|
|
425
425
|
} else {
|
|
426
426
|
el('dash-qstats-tbody').innerHTML = data.map(function(q) {
|
|
427
|
-
var sqlCell = q.digest
|
|
427
|
+
var sqlCell = (q.digest && q.digest.length > 0)
|
|
428
428
|
? '<a href="' + ROUTES.query_detail + encodeURIComponent(q.digest) + '" class="mg-link">' + sqlBlock(q.sql, 120) + '</a>'
|
|
429
429
|
: sqlBlock(q.sql, 120);
|
|
430
430
|
return '<tr>' +
|