Skip to content

Commit 9b97fa1

Browse files
committed
buf fix sort and procedure
1 parent ae8ca66 commit 9b97fa1

File tree

7 files changed

+26
-7
lines changed

7 files changed

+26
-7
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ This text Russian language.
108108
- добавлены новые опции для Vaccum ( DISABLE_PAGE_SKIPPING ) и Reindex ( CONCURRENTLY )
109109
* ускорена работа фильтра в окне результав запроса.
110110

111+
13.04.2020
112+
* исправлено падение в режиме редактирования
113+
* исправлено редактирование процедур без аргументов
114+
111115

112116

113117

Release_(3.0)/pgAdmin3.exe

0 Bytes
Binary file not shown.

ctl/ctlSQLGrid.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,15 @@ ctlSQLGrid::ctlSQLGrid(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
5959
//SetUseNativeColLabels(true);
6060
//UseNativeColHeader(true);
6161
grp=NULL;
62-
62+
isSort=false;
6363
Connect(wxID_ANY, wxEVT_GRID_LABEL_LEFT_DCLICK, wxGridEventHandler(ctlSQLGrid::OnLabelDoubleClick));
6464
}
6565
#include "wx/renderer.h"
6666
#include "wx/headerctrl.h"
6767

6868
void ctlSQLGrid::DrawColLabel( wxDC& dc, int col ) {
6969
wxGrid::DrawColLabel(dc,col);
70+
if (!IsSort()) return;
7071
int colLeft = GetColLeft(col);
7172

7273
wxRect rect(colLeft, 0, GetColWidth(col), m_colLabelHeight);
@@ -516,9 +517,11 @@ void ctlSQLGrid::OnLabelClick(wxGridEvent &event)
516517
if ( col >= 0 && (event.AltDown() ) )
517518
{
518519
// continue for sort event
519-
sqlResultTable *t=(sqlResultTable *)GetTable();
520-
t->setSortColumn(col);
521-
return;
520+
if (IsSort()) {
521+
sqlResultTable *t=(sqlResultTable *)GetTable();
522+
t->setSortColumn(col);
523+
return;
524+
}
522525
}
523526
// add support for (de)selecting multiple rows and cols with Control pressed
524527
else if ( row >= 0 && (event.ControlDown() || event.CmdDown()) )

ctl/ctlSQLResult.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ void ctlSQLResult::DisplayData(bool single)
194194
ProcessTableMessage(*msg);
195195
delete msg;
196196
table->initSort();
197+
SetSort(true);
197198
if (NumRows()<1000) {
198199
for(int row = 0; row < NumRows(); ++row) {
199200
if (row%2==0) {
@@ -679,6 +680,7 @@ sqlResultTable::sqlResultTable()
679680
thread = NULL;
680681
colorder=NULL;
681682
maplines=NULL;
683+
use_map=false;
682684
}
683685

684686
int sqlResultTable::GetNumberRows()

dlg/dlgFunction.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ wxString dlgFunction::GetSql()
927927
{
928928
if (isProcedure && GetArgs().IsEmpty())
929929
{
930-
sql += schema->GetQuotedPrefix() + qtIdent(GetName());
930+
sql += schema->GetQuotedPrefix() + qtIdent(GetName()) + wxT("()");
931931
}
932932
else
933933
{

include/ctl/ctlSQLGrid.h

+10
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ class ctlSQLGrid : public wxGrid
3636
{
3737
return true;
3838
};
39+
bool IsSort()
40+
{
41+
return isSort;
42+
};
43+
void SetSort(bool flag)
44+
{
45+
isSort=flag;
46+
};
47+
3948
wxSize GetBestSize(int row, int col);
4049
void OnLabelDoubleClick(wxGridEvent &event);
4150
void OnLabelClick(wxGridEvent &event);
@@ -65,6 +74,7 @@ class ctlSQLGrid : public wxGrid
6574
ColKeySizeHashMap colSizes;
6675
// Max size for each column
6776
wxArrayInt colMaxSizes;
77+
bool isSort;
6878

6979
};
7080

schema/pgFunction.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ wxString pgProcedure::GetSql(ctlTree *browser)
458458

459459
if (GetArgListWithNames().IsEmpty())
460460
{
461-
qtName = GetQuotedFullIdentifier();
462-
qtSig = GetQuotedFullIdentifier();
461+
qtName = GetQuotedFullIdentifier()+wxT("()");
462+
qtSig = GetQuotedFullIdentifier()+wxT("()");
463463
}
464464
else
465465
{

0 commit comments

Comments
 (0)