File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 173173- New #1082 : Add ` QueryPartsInterface::addWithQuery() ` method (@vjik )
174174- Chg #1082 : ` QueryPartsInterface::withQuery() ` method replace "WITH" clause instead of adding before (@vjik )
175175- Enh #1092 : Change the exceptions thrown to be more appropriate (@Tigrov )
176+ - Bug #1099 : Fix an issue where ` AbstractSchema::refresh() ` didn't completely clear cache (@vjik )
176177
177178## 1.3.0 March 21, 2024
178179
Original file line number Diff line number Diff line change @@ -233,6 +233,9 @@ public function refresh(): void
233233
234234 $ this ->tableNames = [];
235235 $ this ->tableMetadata = [];
236+ $ this ->schemaNames = [];
237+ $ this ->viewNames = [];
238+ $ this ->resultColumns = [];
236239 }
237240
238241 public function refreshTableSchema (string $ name ): void
Original file line number Diff line number Diff line change 66
77use PHPUnit \Framework \TestCase ;
88use Yiisoft \Db \Constant \DataType ;
9+ use Yiisoft \Db \Exception \NotSupportedException ;
910use Yiisoft \Db \Tests \Support \Assert ;
1011use Yiisoft \Db \Tests \Support \TestTrait ;
1112
@@ -61,14 +62,21 @@ public function testGetDataType(): void
6162
6263 public function testRefresh (): void
6364 {
64- $ db = $ this ->getConnection ();
65-
65+ $ db = $ this ->getConnection (true );
6666 $ schema = $ db ->getSchema ();
67- $ schema ->refresh ();
6867
69- $ db ->close ();
68+ try {
69+ $ this ->assertNotEmpty ($ schema ->getTableNames ());
70+ $ this ->assertNotEmpty ($ schema ->getViewNames ());
71+ $ this ->assertNotEmpty ($ schema ->getSchemaNames ());
72+ } catch (NotSupportedException ) {
73+ }
74+
75+ $ schema ->refresh ();
7076
7177 $ this ->assertSame ([], Assert::getPropertyValue ($ schema , 'tableMetadata ' ));
7278 $ this ->assertSame ([], Assert::getPropertyValue ($ schema , 'tableNames ' ));
79+ $ this ->assertSame ([], Assert::getPropertyValue ($ schema , 'schemaNames ' ));
80+ $ this ->assertSame ([], Assert::getPropertyValue ($ schema , 'viewNames ' ));
7381 }
7482}
You can’t perform that action at this time.
0 commit comments