~ubuntu-branches/debian/sid/pgadmin3/sid

« back to all changes in this revision

Viewing changes to pgadmin/schema/pgAggregate.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2009-07-30 12:27:16 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730122716-fddbh42on721bbs2
Tags: 1.10.0-1
* New upstream release.
* Adjusted watch file to match release candidates.
* Updated to Standards-Version 3.8.2:
  - Moved to Section: database.
  - Add DEB_BUILD_OPTIONS support for parallel building.
  - Move from findstring to filter suggestion for DEB_BUILD_OPTIONS parsing.
* pgagent got split into its own separate source package by upstream.
* Exclude Docs.vcproj from installation.
* Move doc-base.enus from pgadmin3 to pgadmin3-data package, the files are
  in there too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//////////////////////////////////////////////////////////////////////////
2
2
//
3
3
// pgAdmin III - PostgreSQL Tools
4
 
// RCS-ID:      $Id: pgAggregate.cpp 6930 2008-01-02 00:10:01Z dpage $
5
 
// Copyright (C) 2002 - 2008, The pgAdmin Development Team
6
 
// This software is released under the Artistic Licence
 
4
// RCS-ID:      $Id: pgAggregate.cpp 7758 2009-03-26 20:49:59Z dpage $
 
5
// Copyright (C) 2002 - 2009, The pgAdmin Development Team
 
6
// This software is released under the BSD Licence
7
7
//
8
8
// pgAggregate.cpp - Aggregate class
9
9
//
56
56
             + wxT(",\n  STYPE=") + GetStateType();
57
57
 
58
58
        AppendIfFilled(sql, wxT(",\n  FINALFUNC="), qtIdent(GetFinalFunction()));
 
59
 
59
60
        if (GetInitialCondition().length() > 0)
60
 
          sql += wxT(",\n  INITCOND=") + qtDbString(GetInitialCondition());
 
61
        {
 
62
            if (GetInitialCondition() == wxT("''"))
 
63
                sql += wxT(",\n  INITCOND=''");
 
64
            else if (GetInitialCondition() == wxT("\\'\\'"))
 
65
                sql += wxT(",\n  INITCOND=''''''");
 
66
            else
 
67
                sql += wxT(",\n  INITCOND=") + qtDbString(GetInitialCondition());
 
68
        }
 
69
 
61
70
        AppendIfFilled(sql, wxT(",\n  SORTOP="), GetQuotedSortOp());
62
71
 
63
72
        sql += wxT("\n);\n")
113
122
        properties->AppendItem(_("Final function"), GetFinalFunction());
114
123
        if (GetConnection()->BackendMinimumVersion(8,1))
115
124
            properties->AppendItem(_("Sort operator"), GetSortOp());
116
 
        properties->AppendItem(_("Initial condition"), GetInitialCondition());
 
125
 
 
126
        if (GetInitialCondition() == wxT(""))
 
127
            properties->AppendItem(_("Initial condition"), _("<null>"));
 
128
        else if (GetInitialCondition() == wxT("''"))
 
129
            properties->AppendItem(_("Initial condition"), _("<empty string>"));
 
130
        else if (GetInitialCondition() == wxT("\\'\\'"))
 
131
            properties->AppendItem(_("Initial condition"), _("''"));
 
132
        else
 
133
            properties->AppendItem(_("Initial condition"), GetInitialCondition());
 
134
 
117
135
        properties->AppendItem(_("System aggregate?"), GetSystemObject());
118
136
        properties->AppendItem(_("Comment"), firstLineOnly(GetComment()));
119
137
    }
170
188
    pgSet *types = collection->GetDatabase()->ExecuteSet(wxT(
171
189
                    "SELECT oid, format_type(oid, typtypmod) AS typname FROM pg_type"));
172
190
 
173
 
    typeMap map;
 
191
    cacheMap map;
174
192
 
175
193
    while(!types->Eof())
176
194
    {
224
242
            wxString final=aggregates->GetVal(wxT("aggfinalfn"));
225
243
            if (final != wxT("-"))
226
244
                aggregate->iSetFinalFunction(final);
227
 
            aggregate->iSetInitialCondition(aggregates->GetVal(wxT("agginitval")));
 
245
 
 
246
            if (!aggregates->IsNull(aggregates->ColNumber(wxT("agginitval"))))
 
247
            {
 
248
                if (aggregates->GetVal(wxT("agginitval")).IsEmpty())
 
249
                    aggregate->iSetInitialCondition(wxT("''"));
 
250
                else if (aggregates->GetVal(wxT("agginitval")) == wxT("''"))
 
251
                    aggregate->iSetInitialCondition(wxT("\\'\\'"));
 
252
                else
 
253
                    aggregate->iSetInitialCondition(aggregates->GetVal(wxT("agginitval")));
 
254
            }
 
255
            
228
256
            aggregate->iSetComment(aggregates->GetVal(wxT("description")));
229
257
            if (collection->GetDatabase()->BackendMinimumVersion(8, 1))
230
258
            {