AnantLabs / wwwsqldesigner

Automatically exported from code.google.com/p/wwwsqldesigner
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

[PostgreSQL import] Invalid XML for tables with no key #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create this table in your database :
      CREATE TABLE session (
          sess_id character varying(32),
          sess_data text,
          sess_time integer
      );
2. As you might notice, there is no PK nor FK
3. Run the designer

What is the expected output? What do you see instead?
You should see all thing going the right way, instead when debugging you 
see this error :
 > error on line 87 at column 272: Opening and ending tag mismatch: table 
line 0 and key

What version of the product are you using? On what operating system?
2.4 on debian+lighttpd+postgresql8.3+php5.3

Please provide any additional information below.
The solution is not to close the </key> tag if it has not already been 
opened.

So, in ./backend/php-postgresql/index.php :

THIS
    $keyname1 = "";
    while ($row2 = pg_fetch_array($result2)){
        ...
    }
    $xml .= '</key>';

Shall become THAT :
    $keyname1 = "";
    while ($row2 = pg_fetch_array($result2)){
        ...
    }
    if($keyname1 != "")
        $xml .= '</key>';

Notice the two last lines.

Original issue reported on code.google.com by geompse@gmail.com on 9 Mar 2010 at 9:37

GoogleCodeExporter commented 9 years ago

Original comment by ondrej.zara on 10 Mar 2010 at 8:50

GoogleCodeExporter commented 9 years ago
Fixed in r80, please verify and confirm :)

Original comment by ondrej.zara on 11 Mar 2010 at 7:36

GoogleCodeExporter commented 9 years ago
great, works :)

Original comment by geompse@gmail.com on 11 Mar 2010 at 1:31