INSERT ... SELECT ... duplicating rows

Issue #359 resolved
Former user created an issue

Running on Synology, 1.9.8-dev, php7

Trying the captioned syntax. There should only be a single row insert, but 2 rows always inserted.

Same statement tried in Sliteman running on Ubuntu only inserts a single row.

Screenshot ...12-00-04 shows the phpsqliteadmin screen with the SQL statement. Screenshot ...12-02-52 shows the resulting table (the table was empty before the SQL statement). Note two rows with the same data.

A similar statement was run from a php file targetting the same database. The php file contained

<?php
  $root='..';
  $db_loc = "$root/central/db.sqlite3";
  $db=new SQLite3($db_loc);
  $db->exec('INSERT INTO transactions (client, unit, operator ) SELECT 1,2,3');

Screenshot ...12-22-38 shows shows the table after the php file was run. Note only one row.

It seems that the problem is with phpliteadmin processing SQL statements (maybe only Synology because I haven't tried this on a server running under another OS). The INSERT ... VALUES syntax yields the same result as INSERT ... SELECT

Comments (6)

  1. phpLiteAdmin repo owner

    Sorry for not responding yet. Mmh, this is strange. I tried to reproduce it, but so far, was not able to. Do you still have this problem?

  2. phpLiteAdmin repo owner

    I could reproduce this now. It happens with the SQLite3 driver, not with the PDO driver.

  3. Log in to comment