Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
103484: ui: fix errors from undefined usage r=maryliag a=maryliag The fix done on cockroachdb#98177 was reverted on cockroachdb#98815, so this commit is adding the check back, which is necessary to not cause an undefined error. Example of error saw on Datadog: <img width="998" alt="Screenshot 2023-05-16 at 6 36 07 PM" src="https://github.com/cockroachdb/cockroach/assets/1017486/0e979df8-e66e-4b3c-9cb6-24ace5dd26fd"> The value for AdminUI could take some time to be initialized, making calls using localStorage fail. This commit adds a check and return an empty object instead of undefined for localStorage. Examples of this error saw on Datadog: <img width="1092" alt="Screenshot 2023-05-16 at 3 59 27 PM" src="https://github.com/cockroachdb/cockroach/assets/1017486/2553fdfc-54f5-4ec1-addf-1af597180e7a"> <img width="1180" alt="Screenshot 2023-05-16 at 4 00 59 PM" src="https://github.com/cockroachdb/cockroach/assets/1017486/f93e7c12-5fdd-490a-b072-298b7b2158ae"> Epic: None Release note (bug fix): Fixes calls to undefined objects. 103514: sql: fix recently introduced bug around the internal rowsIterator r=yuzefovich a=yuzefovich This commit fixes a minor bug introduced in cockroachdb@c7eb1bf that could lead to a nil pointer panic. In particular, that commit introduced `HasResults` method to the `rowsIterator`, and it assumed that `first` field is always non-nil when the iterator was returned on `QueryIteratorEx` call. However, that is not true - in case an error was returned from the connExecutor goroutine, then `rowsIterator.lastErr` is set while `first` is left nil. The expectation is that in such a case the user of the iterator will receive that error either on `Next` or `Close` call, properly cleaning up the iterator. We might want to rethink this and return the error explicitly, but in the spirit of making the least amount of changes, this commit simply added the non-nil check for the `first` field. Fixes: cockroachdb#103508. Release note (bug fix): CockroachDB could previously encounter a nil pointer crash when populating data for SQL Activity page in some rare cases, and this is now fixed. The bug is present in 22.2.9 and 23.1.1 releases. Co-authored-by: maryliag <[email protected]> Co-authored-by: Yahor Yuzefovich <[email protected]>
- Loading branch information