Skip to content

Commit

Permalink
修复表结构显示不正确的 bug (#2406)
Browse files Browse the repository at this point in the history
* 修复表结构显示不正确的 bug

* f
  • Loading branch information
LeoQuote authored Nov 23, 2023
1 parent 5fd57db commit 527eb30
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sql/templates/sqlquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -703,11 +703,12 @@ <h4 class="modal-title text-danger">收藏语句</h4>
var active_li_id = sessionStorage.getItem('active_li_id');
let active_li_title = sessionStorage.getItem('active_li_title');
let tb_name
let need_describe_display = false
if (data.status === 0) {
// 查看表结构默认新增tab相同表结构获取不新增
if (result['full_sql'].match(/^show\s+create\s+table\s+(.*)/)) {
need_describe_display = true
if (data.is_describe===undefined || !data.is_describe) {
data.is_describe = true
tb_name = result['full_sql'].match(/^show\s+create\s+table\s+(.*);/)[1];
}
}
Expand All @@ -719,6 +720,9 @@ <h4 class="modal-title text-danger">收藏语句</h4>
tab_add(tb_name);
}
n = sessionStorage.getItem('tab_num');
if (result.column_list === ["table", "create table"]) {
need_describe_display = true
}
}
// 执行结果页默认不新增
else if (active_li_title.match(/^执行结果\d$/)) {
Expand Down Expand Up @@ -768,7 +772,7 @@ <h4 class="modal-title text-danger">收藏语句</h4>
}
});
});
if (data.is_describe) {
if (need_describe_display) {
//初始化表结构显示
$("#" + ("query_result" + n)).bootstrapTable('destroy').bootstrapTable({
escape: false,
Expand Down

0 comments on commit 527eb30

Please sign in to comment.