diff --git a/Release_(3.0)/pgAdmin3.exe b/Release_(3.0)/pgAdmin3.exe index 30bfffa..5eadb5d 100644 Binary files a/Release_(3.0)/pgAdmin3.exe and b/Release_(3.0)/pgAdmin3.exe differ diff --git a/ctl/ctlSQLBox.cpp b/ctl/ctlSQLBox.cpp index 42c4dc5..4f5e8ee 100644 --- a/ctl/ctlSQLBox.cpp +++ b/ctl/ctlSQLBox.cpp @@ -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= 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); diff --git a/frm/frmStatus.cpp b/frm/frmStatus.cpp index 085d0da..ab46452 100644 --- a/frm/frmStatus.cpp +++ b/frm/frmStatus.cpp @@ -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