summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it_dbi.class4
1 files changed, 4 insertions, 0 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 68ba6a0..413ca8d 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -117,6 +117,7 @@ function createclasses($p = array())
for ($tables = array(), $res = $dbi->query('SHOW TABLES', $p); $row = mysql_fetch_row($res);)
$tables[] = $row[0];
+ $state = it_dbi::_state_get($dbid); # State could have been modified by query above
$state['tables'] = $tables;
it_dbi::_state_put($dbid, $state);
}
@@ -154,6 +155,7 @@ function createclass($p)
for ($tables = array(), $res = $dbi->query('SHOW TABLES', $p); $row = mysql_fetch_row($res);)
$tables[] = $row[0];
+ $state = it_dbi::_state_get($dbid); # State could have been modified by query above
$state['tables'] = $tables;
it_dbi::_state_put($dbid, $state);
}
@@ -225,6 +227,7 @@ function _connect($p = array())
if ($p['charset'])
mysql_set_charset($p['charset'], $this->_link);
+ # NOTE: This overwrites old state but that is on purpose. New link means we should refetch all info about connection
$state['link'] = $this->_link;
it_dbi::_state_put($dbid, $state, false); # Store only locally as link is not shared anyway
}
@@ -738,6 +741,7 @@ function _get_field_info()
$this->_isint[$field['Field']] = preg_match('/^(tiny|small|medium|)int/', $field['Type']);
}
+ $state = it_dbi::_state_get($dbid); # State could have been modified by query above
$state['fields'][$this->_p['table']] = $this->_fields;
$state['isint'][$this->_p['table']] = $this->_isint;
it_dbi::_state_put($dbid, $state);