pg_query_state incorrect  visible
Avtoselect query fix non-ansi char
This commit is contained in:
levinsv 2019-09-01 19:14:59 +05:00
parent 8b4475f02d
commit a12676df94
3 changed files with 12 additions and 6 deletions

Binary file not shown.

View file

@ -991,6 +991,7 @@ long ctlSQLBox::SelectQuery(int startposition)
int match;
int pend=endPos;
int pstart=0;
if ((ch == ';')) {
pend=pos;
pos=pos-1;
@ -998,21 +999,23 @@ long ctlSQLBox::SelectQuery(int startposition)
{
while (pos<endPos) {
ch = GetCharAt(pos);
st = GetStyleAt(pos);
st = GetStyleAt(pos) & 0x1F;
if ((ch == ';') &&
st != 2 && st != 6 && st != 7)
{
pend=pos;
break;
}
pos++;
int i=IsDBCSLeadByte(ch)? 2 : 1;
pos=pos+i;
}
}
while ((pos--) >= 0)
pos--;
while ((pos) >= 0)
{
ch = GetCharAt(pos);
st = GetStyleAt(pos);
st = GetStyleAt(pos) & 0x1F;
if ((ch == ';') &&
st != 2 && st != 6 && st != 7)
{
@ -1020,6 +1023,8 @@ long ctlSQLBox::SelectQuery(int startposition)
break;
}
if (ch>' ') pstart=pos;
int i=IsDBCSLeadByte(ch)? 2 : 1;
pos=pos-i;
}
if (startposition<0) SetSelection(pstart,pend);

View file

@ -395,8 +395,9 @@ frmStatus::frmStatus(frmMain *form, const wxString &_title, pgConn *conn) : pgFr
viewMenu->Check(MNU_LOCKPAGE, manager.GetPane(wxT("Locks")).IsShown());
viewMenu->Check(MNU_XACTPAGE, manager.GetPane(wxT("Transactions")).IsShown());
viewMenu->Check(MNU_LOGPAGE, manager.GetPane(wxT("Logfile")).IsShown());
pgSet *set = connection->ExecuteSet(wxT("SELECT 1 FROM pg_available_extensions WHERE name='pg_query_state'"));
pgSet *set = connection->ExecuteSet(wxT("SELECT 1 FROM pg_available_extensions WHERE installed_version is not null and name='pg_query_state'"));
viewMenu->Enable(MNU_QUERYSTATEPAGE,set->NumRows() == 1);
//viewMenu->Check(MNU_QUERYSTATEPAGE,set->NumRows() == 1);
delete set;
viewMenu->Check(MNU_TOOLBAR, manager.GetPane(wxT("toolBar")).IsShown());
@ -974,7 +975,7 @@ void frmStatus::AddQuerystatePane()
// Create the timer
querystateTimer = new wxTimer(this, TIMER_QUERYSTATE_ID);
pgSet *set = connection->ExecuteSet(wxT("SELECT 1 FROM pg_available_extensions WHERE name='pg_query_state'"));
pgSet *set = connection->ExecuteSet(wxT("SELECT 1 FROM pg_available_extensions WHERE installed_version is not null and name='pg_query_state'"));
if (set->NumRows() == 1)
viewMenu->Check(MNU_QUERYSTATEPAGE,true);
else