From e0173f45b90bfd11c076d0f5a996ac50dafe2bc9 Mon Sep 17 00:00:00 2001 From: Marco Villegas Date: Mon, 18 Jul 2011 12:14:39 -0500 Subject: [PATCH] Issue #1195802 follow-up by marvil07: Added mssql_fetch_batch near all mssql_fetch_object calls on MigrateSourceMSSQL::next(). --- plugins/sources/mssql.inc | 34 +++++++++++++++++++++++----------- 1 files changed, 23 insertions(+), 11 deletions(-) diff --git a/plugins/sources/mssql.inc b/plugins/sources/mssql.inc index e55a21f..89083f4 100644 --- a/plugins/sources/mssql.inc +++ b/plugins/sources/mssql.inc @@ -229,18 +229,18 @@ class MigrateSourceMSSQL extends MigrateSource { migrate_instrument_start('mssql_fetch_object'); $this->currentRow = mssql_fetch_object($this->result); migrate_instrument_stop('mssql_fetch_object'); - while ($this->currentRow) { - // Might be totally out of data, or just out of this batch - request another - // batch and see - if (!is_object($this->currentRow)) { - migrate_instrument_start('mssql_fetch_batch'); - mssql_fetch_batch($this->result); - migrate_instrument_stop('mssql_fetch_batch'); + // Might be totally out of data, or just out of this batch - request another + // batch and see + if (!is_object($this->currentRow)) { + migrate_instrument_start('mssql_fetch_batch'); + mssql_fetch_batch($this->result); + migrate_instrument_stop('mssql_fetch_batch'); - migrate_instrument_start('mssql_fetch_object'); - $this->currentRow = mssql_fetch_object($this->result); - migrate_instrument_stop('mssql_fetch_object'); - } + migrate_instrument_start('mssql_fetch_object'); + $this->currentRow = mssql_fetch_object($this->result); + migrate_instrument_stop('mssql_fetch_object'); + } + while ($this->currentRow) { if (!is_object($this->currentRow)) { $this->currentRow = NULL; break; @@ -270,6 +270,18 @@ class MigrateSourceMSSQL extends MigrateSource { migrate_instrument_start('mssql_fetch_object'); $this->currentRow = mssql_fetch_object($this->result); migrate_instrument_stop('mssql_fetch_object'); + + // Might be totally out of data, or just out of this batch - request another + // batch and see + if (!is_object($this->currentRow)) { + migrate_instrument_start('mssql_fetch_batch'); + mssql_fetch_batch($this->result); + migrate_instrument_stop('mssql_fetch_batch'); + + migrate_instrument_start('mssql_fetch_object'); + $this->currentRow = mssql_fetch_object($this->result); + migrate_instrument_stop('mssql_fetch_object'); + } } if (!is_object($this->currentRow)) { $this->currentRow = NULL; -- 1.7.5.4