[ms planner] fix buggy temp table name generation, may generate duplicated unique id with subqueries/union stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 06 Apr 2011 22:52:52 +0200
branchstable
changeset 7191 1e2d8e4d2c7b
parent 7190 f72e3f4666b0
child 7192 9e92c8558fea
[ms planner] fix buggy temp table name generation, may generate duplicated unique id with subqueries/union
server/msplanner.py
--- a/server/msplanner.py	Wed Apr 06 22:52:51 2011 +0200
+++ b/server/msplanner.py	Wed Apr 06 22:52:52 2011 +0200
@@ -1420,9 +1420,7 @@
                             steps.append(ppi.build_final_part(minrqlst, solindices, inputmap,
                                                               sources, insertedvars))
                 else:
-                    table = '_T%s%s' % (''.join(sorted(v._ms_table_key() for v in terms)),
-                                        ''.join(sorted(str(i) for i in solindices)))
-                    table = plan.make_temp_table_name(table)
+                    table = plan.make_temp_table_name('T%s' % make_uid(id(select)))
                     ppi.build_non_final_part(minrqlst, solindices, sources,
                                              insertedvars, table)
         # finally: join parts, deal with aggregat/group/sorts if necessary