Solve unexported field or method panic #1819

Closed
northfun wants to merge 14 commits from solve_unexported_field into patch
Contributor

Protobuf3 generates lowercase members in structs instead of members with prefix XXX.
I have been using protobuf with protoc-go-inject-tag to generate xorm tables for a long time, it is really convenient and improved development efficiency.But when I tried to upgrade protobuf and grpc to current stable version, I got the panic panic: reflect.Value.Interface: cannot return value obtained from unexported field or method.
For forward compatible, and not to change so much codes, I updated these codes and checked with make build & make test.My programs work well now, it seems that the problem is solved.
I wander why not passing the !fileValue.CanSet() members for such a long time, is there any reason not do so?

Protobuf3 generates lowercase members in structs instead of members with prefix `XXX`. I have been using protobuf with `protoc-go-inject-tag` to generate `xorm` tables for a long time, it is really convenient and improved development efficiency.But when I tried to upgrade protobuf and grpc to current stable version, I got the panic `panic: reflect.Value.Interface: cannot return value obtained from unexported field or method`. For forward compatible, and not to change so much codes, I updated these codes and checked with `make build & make test`.My programs work well now, it seems that the problem is solved. I wander why not passing the `!fileValue.CanSet()` members for such a long time, is there any reason not do so?
northfun added 14 commits 2020-10-30 01:51:38 +00:00
chore: enable fmt check (#1742)
chore: enable fmt check

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Reviewed-on: #1742
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
All checks were successful
continuous-integration/drone/push Build is passing
fe3bc3851e
Fix typo (#1748)
Fix typo

Co-authored-by: Masataka Hisasue <masataka.hisasue@optim.co.jp>
Reviewed-on: #1748
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
All checks were successful
continuous-integration/drone/push Build is passing
4a6b8c29bf
solve duplicate log in commit and rollback (#1750)
solve duplicate log in commit and rollback

Co-authored-by: Lyi <zhanghong@zuodashi.com>
Reviewed-on: #1750
Reviewed-by: helong zhang <outman99@hotmail.com>
All checks were successful
continuous-integration/drone/push Build is passing
f39a4cb41c
Fix mysql dialect error from invalid db identifier in orderby clause (#1743) (#1751)
Fix mysql dialect error from invalid db identifier in orderby clause (#1743)

Reviewed-on: #1751
All checks were successful
continuous-integration/drone/push Build is passing
76d6b9fdf5
Correct default detection in MariaDB >= 10.2.7 (#1778)
try again ci

Signed-off-by: Andrew Thornton <art27@cantab.net>

try again ci

Signed-off-by: Andrew Thornton <art27@cantab.net>

tidy up appearance of the alreadyQuoted SQL string

Signed-off-by: Andrew Thornton <art27@cantab.net>

Merge remote-tracking branch 'origin/master' into fix-defaults-sync2-mysql

Try MariaDB 10.4

Signed-off-by: Andrew Thornton <art27@cantab.net>

fix drone

Signed-off-by: Andrew Thornton <art27@cantab.net>

Correct default detection in MariaDB >= 10.2.7

MariaDB in version 10.2.7 changed the reporting of COLUMN_DEFAULT in
INFORMATION_SCHEMA.COLUMNS to quote string values.

This PR adds a version detection test to the columns query.

References: https://jira.mariadb.org/browse/MDEV-13132
References: https://jira.mariadb.org/browse/MDEV-15390

Signed-off-by: Andrew Thornton <art27@cantab.net>

Reviewed-on: #1778
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
All checks were successful
continuous-integration/drone/push Build is passing
f8c91ec4a3
Add changelog for v1.0.4
Some checks failed
continuous-integration/drone/push Build is failing
b10919ec56
Fix bug on get columns for postgres (#1779)
Fix bug on get columns for postgres

Reviewed-on: #1779
Some checks failed
continuous-integration/drone/push Build is failing
3e0179ff26
Do not ever quote asterisk symbol. Fixes #1780 (#1781)
Do not ever quote asterisk symbol. Fixes #1780

Co-authored-by: Lauris BH <lauris@nix.lv>
Reviewed-on: #1781
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Some checks failed
continuous-integration/drone/push Build is failing
01e1e98dd5
Fix warnings with schema Sync2 with default varchar as NVARCHAR (#1783)
prod CI

Merge branch 'fix-1782-MSSQL-nvarchar-fixes' of gitea.com:zeripath/xorm into fix-1782-MSSQL-nvarchar-fixes

map "character" to Char for postgres

Signed-off-by: Andrew Thornton <art27@cantab.net>

Merge branch 'master' into fix-1782-MSSQL-nvarchar-fixes

Postgres (and cockroachDB by inheritance) maps Char to Varchar

Signed-off-by: Andrew Thornton <art27@cantab.net>

fix test

Add a few more column testcases in light of postgres weirdness

prod CI

prod CI

prod CI

Properly handle MAX

Signed-off-by: Andrew Thornton <art27@cantab.net>

Add tests for Test and Char columns

Signed-off-by: Andrew Thornton <art27@cantab.net>

prod CI

fix test

Signed-off-by: Andrew Thornton <art27@cantab.net>

Remove the duplicate mssql drone test and add a specific sync test

Signed-off-by: Andrew Thornton <art27@cantab.net>

add depends_on (2)

Signed-off-by: Andrew Thornton <art27@cantab.net>

add depends_on

Signed-off-by: Andrew Thornton <art27@cantab.net>

add nvarchar as a testcase

Signed-off-by: Andrew Thornton <art27@cantab.net>

Set defaultVarchar to upper case

Signed-off-by: Andrew Thornton <art27@cantab.net>

Fix length issue

Signed-off-by: Andrew Thornton <art27@cantab.net>

schemas.Text should map to db.defaultVarchar

Signed-off-by: Andrew Thornton <art27@cantab.net>

Add failing test

Signed-off-by: Andrew Thornton <art27@cantab.net>

Reviewed-on: #1783
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Some checks failed
continuous-integration/drone/push Build is failing
b422930617
Fix bug of ToDB when update on a nil pointer (#1786)
Fix test

Fix bug

Fix bug

Add test for insert nil struct field

Fix test

Fix bug of ToDB when update on a nil pointer

Reviewed-on: #1786
Some checks failed
continuous-integration/drone/push Build is failing
1b200bdcba
Change log for v1.0.5
All checks were successful
continuous-integration/drone/push Build is passing
e35662b1ed
Performance improvement for columnsbyName (#1788)
Performance improvement for columnsbyName

Reviewed-on: #1788
Some checks failed
continuous-integration/drone/push Build is failing
0c1b815227
feat: define xorm.FromDialectAndDB (#1812)
refactor: rename the function name

feat: define xorm.FromDialectAndDB

Co-authored-by: jumpeiMano <jumpeim37@gmail.com>
Reviewed-on: #1812
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-Authored-By: jumpeiMano <jumpeimano@noreply.gitea.io>
Co-Committed-By: jumpeiMano <jumpeimano@noreply.gitea.io>
17f28a1314
Update 'tags/parser.go'
Solve runtime problem:"panic: reflect.Value.Interface: cannot return value obtained from unexported field or method"
Some checks reported errors
continuous-integration/drone/pr Build encountered an error
756fdfdd79
Owner

Please resolve the conflicts.

Please resolve the conflicts.
lunny closed this pull request 2021-04-12 06:05:45 +00:00
Some checks reported errors
continuous-integration/drone/pr Build encountered an error

Pull request closed

Sign in to join this conversation.
No description provided.