Skip to content

Commit

Permalink
auto_order optional
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.toolserver.org/svnroot/daniel/duesenstuff/trunk/gpClient@625 9f2c43bc-b3c0-43f4-b155-41619b16f219
  • Loading branch information
Daniel Kinzler committed Feb 14, 2012
1 parent 50efd4b commit 06fc387
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python/gp/mediawiki.py
Expand Up @@ -256,7 +256,7 @@ def make_id_source ( self, ns = None ) :
return self.make_source( ns, True )


def make_source ( self, ns = None, ids_only = False ) :
def make_source ( self, ns = None, ids_only = False, auto_order = False ) : #TODO: PORT auto_order to PHP
t = self.table_id_obj if ids_only else self.table_obj

if ( ns is not None ) :
Expand All @@ -268,7 +268,7 @@ def make_source ( self, ns = None, ids_only = False ) :
t = MySQLSelect(select)


src = self.glue.make_source( t, self.big )
src = self.glue.make_source( t, big = self.big, auto_order = auto_order )
return src


Expand Down
4 changes: 2 additions & 2 deletions python/gp/mysql.py
Expand Up @@ -660,10 +660,10 @@ def make_sink (self, table ):
return sink


def make_source (self, table, big = False, **kwargs ):
def make_source (self, table, big = False, auto_order = False, **kwargs ): #TODO: PORT auto_order to PHP
sql = table._get_select()

if not re.search(r'\s+ORDER\s+BY\s+', sql, flags = re.IGNORECASE | re.DOTALL ) :
if auto_order and not re.search(r'\s+ORDER\s+BY\s+', sql, flags = re.IGNORECASE | re.DOTALL ) : #TODO: PORT auto_order to PHP
sql += ' ' + table.get_order_by()

if not 'unbuffered' in kwargs:
Expand Down

0 comments on commit 06fc387

Please sign in to comment.