self.step(offset)
query = "INSERT INTO %s.media_collections (\n %s\n)\n" \
- "SELECT \n %s\n FROM %s.Support AS s LIMIT %d, 1" % (
+ "SELECT \n %s\n FROM %s.Support AS s ORDER BY Cote LIMIT %d, 1" % (
self.target_db_name,
",\n ".join(target_fields),
",\n ".join(src_fields),
except IntegrityError, e:
(errno, errmsg) = e
if errno == DUP_ENTRY:
- self.src_cursor.execute("SELECT Cote FROM %s.Support LIMIT %d, 1" % (self.src_db_name, offset))
+ self.src_cursor.execute("SELECT Cote FROM %s.Support ORDER BY Cote LIMIT %d, 1" % (self.src_db_name, offset))
id = self.src_cursor.fetchone()[0]
self.warn("Collection %s not imported: %s" % (id, errmsg))
self.stats['ignored'] += 1