Rev 1156 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1156 | Rev 1453 | ||
---|---|---|---|
Line 40... | Line 40... | ||
40 | public function __construct($res) { |
40 | public function __construct($res) { |
41 | $this->no_resultset = is_bool($res); |
41 | $this->no_resultset = is_bool($res); |
42 | 42 | ||
43 | if (!$this->no_resultset) { |
43 | if (!$this->no_resultset) { |
44 | $this->res = $res; |
44 | $this->res = $res; |
- | 45 | ||
- | 46 | // Since caching prepared statements will cause the testcase "Simultanous prepared statements" to fail, |
|
- | 47 | // this will fix it. |
|
- | 48 | $this->prefetchAll(); |
|
45 | } |
49 | } |
46 | } |
50 | } |
47 | 51 | ||
48 | /** |
52 | /** |
49 | * |
53 | * |
Line 97... | Line 101... | ||
97 | 101 | ||
98 | return $ret; |
102 | return $ret; |
99 | } |
103 | } |
100 | 104 | ||
101 | /** |
105 | /** |
- | 106 | * Goes to the last result set (in case a query returns multiple result sets) |
|
- | 107 | * @return void |
|
- | 108 | */ |
|
- | 109 | protected function gotoLastResultSet() { |
|
- | 110 | while (@odbc_next_result($this->res)) { |
|
- | 111 | // Do nothing |
|
- | 112 | } |
|
- | 113 | } |
|
- | 114 | ||
- | 115 | /** |
|
102 | * @return array|null |
116 | * @return array|null |
103 | */ |
117 | */ |
104 | protected function do_fetch_array()/*: ?array*/ { |
118 | protected function do_fetch_array()/*: ?array*/ { |
- | 119 | //$this->gotoLastResultSet(); // TODO: This causes problems (read dbms_version on null) |
|
105 | $ret = odbc_fetch_array($this->res); |
120 | $ret = @odbc_fetch_array($this->res); |
106 | if ($ret === false) $ret = null; |
121 | if ($ret === false) $ret = null; |
107 | return $ret; |
122 | return $ret; |
108 | } |
123 | } |
109 | 124 | ||
110 | /** |
125 | /** |
111 | * @return object|null |
126 | * @return object|null |
112 | */ |
127 | */ |
113 | protected function do_fetch_object()/*: ?object*/ { |
128 | protected function do_fetch_object()/*: ?object*/ { |
- | 129 | //$this->gotoLastResultSet(); // TODO: This causes problems (read dbms_version on null) |
|
114 | $ret = odbc_fetch_object($this->res); |
130 | $ret = @odbc_fetch_object($this->res); |
115 | if ($ret === false) $ret = null; |
131 | if ($ret === false) $ret = null; |
116 | return $ret; |
132 | return $ret; |
117 | } |
133 | } |
118 | } |
134 | } |