SVN Commit by andreas: r4591 - in trunk/pgadmin3: . src/slony src/ui - Mailing list pgadmin-hackers

From svn@pgadmin.org
Subject SVN Commit by andreas: r4591 - in trunk/pgadmin3: . src/slony src/ui
Date
Msg-id 200510230902.j9N92hRc008676@developer.pgadmin.org
Whole thread Raw
List pgadmin-hackers
Author: andreas
Date: 2005-10-23 10:02:42 +0100 (Sun, 23 Oct 2005)
New Revision: 4591

Modified:
   trunk/pgadmin3/CHANGELOG.txt
   trunk/pgadmin3/src/slony/dlgRepCluster.cpp
   trunk/pgadmin3/src/ui/dlgServer.xrc
   trunk/pgadmin3/src/ui/xrcDialogs.cpp
Log:
Fix crash when extracting schema from slony cluster

Modified: trunk/pgadmin3/CHANGELOG.txt
===================================================================
--- trunk/pgadmin3/CHANGELOG.txt    2005-10-22 15:04:52 UTC (rev 4590)
+++ trunk/pgadmin3/CHANGELOG.txt    2005-10-23 09:02:42 UTC (rev 4591)
@@ -17,6 +17,7 @@
 </ul>
 <br>
 <ul>
+    <li>2005-10-23 AP  1.4B4 Fix crash when extracting schema from slony cluster
     <li>2005-10-22 AP  1.4B4 Fix New.. context menu
     <li>2005-10-21 AP  1.4B4 Fix Create a.. toolbar button on collection (r: Li Fei)
     <li>2005-10-20 AP  1.4B4 Fix Maintenance crash of disconnected DBs (r: A.J.Langereis)

Modified: trunk/pgadmin3/src/slony/dlgRepCluster.cpp
===================================================================
--- trunk/pgadmin3/src/slony/dlgRepCluster.cpp    2005-10-22 15:04:52 UTC (rev 4590)
+++ trunk/pgadmin3/src/slony/dlgRepCluster.cpp    2005-10-23 09:02:42 UTC (rev 4591)
@@ -354,13 +354,15 @@
         wxString schemaPrefix = qtIdent(wxT("_") + cbClusterName->GetValue()) + wxT(".");
         long adminNodeID = settings->Read(wxT("Replication/") + cbClusterName->GetValue() + wxT("/AdminNode"), -1L);

+        remoteVersion = remoteConn->ExecuteScalar(wxT("SELECT ") + schemaPrefix + wxT("slonyVersion();"));
+
         wxString sql=
-            wxT("SELECT no_id, no_comment, ") + schemaPrefix + wxT("slonyVersion() as version\n")
+            wxT("SELECT no_id, no_comment\n")
             wxT("  FROM ") + schemaPrefix + wxT("sl_node\n")
             wxT("  JOIN ") + schemaPrefix + wxT("sl_path ON no_id = pa_client\n")
-            wxT(" WHERE pa_server = (SELECT last_value FROM ") + schemaPrefix + wxT("sl_local_node_id)")
-            wxT("   AND pa_conninfo LIKE ") + qtString(wxT("%host=") + remoteServer->GetName() + wxT("%")) +
-            wxT("   AND pa_conninfo LIKE ") + qtString(wxT("%dbname=") + cbDatabase->GetValue() + wxT("%"));
+            wxT(" WHERE pa_server = (SELECT last_value FROM ") + schemaPrefix + wxT("sl_local_node_id)\n")
+            wxT("   AND pa_conninfo ILIKE ") + qtString(wxT("%host=") + remoteServer->GetName() + wxT("%")) +
wxT("\n")
+            wxT("   AND pa_conninfo LIKE ") + qtString(wxT("%dbname=") + cbDatabase->GetValue() + wxT("%")) +
wxT("\n");

         if (remoteServer->GetPort() != 5432)
             sql += wxT("   AND pa_conninfo LIKE ") + qtString(wxT("%port=") + NumToStr((long)remoteServer->GetPort())
+wxT("%")); 
@@ -370,7 +372,6 @@
         {
             if (!set->Eof())
             {
-                remoteVersion = set->GetVal(wxT("version"));
                 long id = set->GetLong(wxT("no_id"));
                 cbAdminNode->Append(IdAndName(id, set->GetVal(wxT("no_comment"))), (void*)id);
                 if (adminNodeID == id)
@@ -758,7 +759,8 @@
             while (process)
             {
                 wxSafeYield();
-                clusterBackup += process->ReadInputStream();
+                if (process)
+                    clusterBackup += process->ReadInputStream();
                 wxSafeYield();
                 wxMilliSleep(10);
             }

Modified: trunk/pgadmin3/src/ui/dlgServer.xrc
===================================================================
--- trunk/pgadmin3/src/ui/dlgServer.xrc    2005-10-22 15:04:52 UTC (rev 4590)
+++ trunk/pgadmin3/src/ui/dlgServer.xrc    2005-10-23 09:02:42 UTC (rev 4591)
@@ -9,193 +9,243 @@
           <object class="wxStaticText" name="stName">


+
             <label>Address</label>


+
             <pos>5,7d</pos>
           </object>
           <object class="wxTextCtrl" name="txtName">


+
             <pos>70,5d</pos>


+
             <size>135,-1d</size>
           </object>
           <object class="wxStaticText" name="stDescription">


+
             <label>Description</label>


+
             <pos>5,22d</pos>
           </object>
           <object class="wxTextCtrl" name="txtDescription">


+
             <pos>70,20d</pos>


+
             <size>135,-1d</size>
           </object>
           <object class="wxStaticText" name="stService">


+
             <label>Service</label>


+
             <pos>5,37d</pos>
           </object>
           <object class="wxTextCtrl" name="txtService">


+
             <pos>70,35d</pos>


+
             <size>135,-1d</size>
           </object>
           <object class="wxStaticText" name="stPort">


+
             <label>Port</label>


+
             <pos>5,52d</pos>
           </object>
           <object class="wxTextCtrl" name="txtPort">


+
             <pos>70,50d</pos>


-            <size>26,-1d</size>
+
+            <size>28,-1d</size>
           </object>
           <object class="wxStaticText" name="stSSL">


+
             <label>SSL</label>


-            <pos>100,52d</pos>
+
+            <pos>105,52d</pos>
           </object>
           <object class="wxComboBox" name="cbSSL">


+
             <pos>120,50d</pos>


+
             <size>85,12d</size>


+
             <style>wxCB_READONLY|wxCB_DROPDOWN</style>


+
             <content/>
           </object>
           <object class="wxStaticText" name="stDatabase">


+
             <label>Maintenance DB</label>


+
             <pos>5,67d</pos>
           </object>
           <object class="wxComboBox" name="cbDatabase">


+
             <pos>70,65d</pos>


+
             <size>135,12d</size>


+
             <content/>


+
             <style>wxCB_DROPDOWN</style>
           </object>
           <object class="wxStaticText" name="stUsername">


+
             <label>Username</label>


+
             <pos>5,82d</pos>
           </object>
           <object class="wxTextCtrl" name="txtUsername">


+
             <pos>70,80d</pos>


+
             <size>135,-1d</size>
           </object>
           <object class="wxStaticText" name="stTryConnect">


+
             <label>Connect now</label>


+
             <pos>5,97d</pos>
           </object>
           <object class="wxCheckBox" name="chkTryConnect">


+
             <label></label>


+
             <checked>1</checked>


+
             <pos>70,95d</pos>


+
             <size>12,12d</size>
           </object>
           <object class="wxStaticText" name="stStorePwd">


+
             <label>store password</label>


+
             <pos>105,97d</pos>
           </object>
           <object class="wxCheckBox" name="chkStorePwd">


+
             <label></label>


+
             <checked>1</checked>


+
             <pos>170,95d</pos>


+
             <size>12,12d</size>
           </object>
           <object class="wxStaticText" name="stPassword">


+
             <label>Password</label>


+
             <pos>5,112d</pos>
           </object>
           <object class="wxTextCtrl" name="txtPassword">


+
             <pos>70,110d</pos>


+
             <style>wxTE_PASSWORD</style>


+
             <size>135,-1d</size>
           </object>
         </object>


+
         <selected>1</selected>
       </object>
       <pos>2,2d</pos>
@@ -204,28 +254,35 @@
     <object class="wxButton" name="wxID_HELP">


+
       <label>Help</label>


+
       <pos>2,150d</pos>
     </object>
     <object class="wxButton" name="wxID_OK">


+
       <label>OK</label>


+
       <default>1</default>


+
       <pos>113,150d</pos>
     </object>
     <object class="wxButton" name="wxID_CANCEL">


+
       <label>Cancel</label>


+
       <pos>166,150d</pos>
     </object>
     <size>218,168d</size>

Modified: trunk/pgadmin3/src/ui/xrcDialogs.cpp
===================================================================
--- trunk/pgadmin3/src/ui/xrcDialogs.cpp    2005-10-22 15:04:52 UTC (rev 4590)
+++ trunk/pgadmin3/src/ui/xrcDialogs.cpp    2005-10-23 09:02:42 UTC (rev 4591)
@@ -8,6 +8,9 @@
     #pragma hdrstop
 #endif

+#ifndef WX_PRECOMP
+    #include <wx/wx.h>
+#endif
 #include <wx/filesys.h>
 #include <wx/fs_mem.h>
 #include <wx/xrc/xmlres.h>
@@ -6961,13 +6964,13 @@
 97,115,115,61,34,119,120,84,101,120,116,67,116,114,108,34,32,110,97,109,
 101,61,34,116,120,116,80,111,114,116,34,62,10,32,32,32,32,32,32,32,32,32,
 32,32,32,60,112,111,115,62,55,48,44,53,48,100,60,47,112,111,115,62,10,32,
-32,32,32,32,32,32,32,32,32,32,32,60,115,105,122,101,62,50,54,44,45,49,100,
+32,32,32,32,32,32,32,32,32,32,32,60,115,105,122,101,62,50,56,44,45,49,100,
 60,47,115,105,122,101,62,10,32,32,32,32,32,32,32,32,32,32,60,47,111,98,
 106,101,99,116,62,10,32,32,32,32,32,32,32,32,32,32,60,111,98,106,101,99,
 116,32,99,108,97,115,115,61,34,119,120,83,116,97,116,105,99,84,101,120,
 116,34,32,110,97,109,101,61,34,115,116,83,83,76,34,62,10,32,32,32,32,32,
 32,32,32,32,32,32,32,60,108,97,98,101,108,62,83,83,76,60,47,108,97,98,101,
-108,62,10,32,32,32,32,32,32,32,32,32,32,32,32,60,112,111,115,62,49,48,48,
+108,62,10,32,32,32,32,32,32,32,32,32,32,32,32,60,112,111,115,62,49,48,53,
 44,53,50,100,60,47,112,111,115,62,10,32,32,32,32,32,32,32,32,32,32,60,47,
 111,98,106,101,99,116,62,10,32,32,32,32,32,32,32,32,32,32,60,111,98,106,
 101,99,116,32,99,108,97,115,115,61,34,119,120,67,111,109,98,111,66,111,


pgadmin-hackers by date:

Previous
From: svn@pgadmin.org
Date:
Subject: SVN Commit by andreas: r4590 - in trunk/pgadmin3: . src/main
Next
From: svn@pgadmin.org
Date:
Subject: SVN Commit by andreas: r4592 - trunk/pgadmin3/src/dlg