mongo_fdw
mongo_fdw copied to clipboard
Fix bug of mongo_fdw in Mar-2022
We have fix 2 bugs of your repository. I'd like to create a PR to contribute them to your repository.
On Tue, Mar 29, 2022 at 1:19 PM Vu Manh Khieu @.***> wrote:
We have fix 2 bugs of your repository. I'd like to create a PR to contribute them to your repository.
- Fix convert UTF8 bson type to name postgres type https://github.com/khieuvm/mongo_fdw/commit/e80a5a720a3279dcc6064cfefc3750104dd7c7a1
Why do you think that UTF8 bson type should be mapped to the name type at the PostgreSQL side? Can you please explain the same?
We map UTF8 bson type to TEXT type which seems more correct.
- Fix check range value of int64 type https://github.com/khieuvm/mongo_fdw/commit/0d5cc0586c8052604b93e1c53d45a8dff5b50271
We can't assign a > int32 value to an int32 variable. And thus throwing an error is the correct way. Storing a wrong overflow value is NOT good.
You can view, comment on, or merge this pull request online at:
https://github.com/EnterpriseDB/mongo_fdw/pull/159 Commit Summary
- 0d5cc05 https://github.com/EnterpriseDB/mongo_fdw/pull/159/commits/0d5cc0586c8052604b93e1c53d45a8dff5b50271 Fix check range value of int64 type
- e80a5a7 https://github.com/EnterpriseDB/mongo_fdw/pull/159/commits/e80a5a720a3279dcc6064cfefc3750104dd7c7a1 Fix convert UTF8 bson type to name postgres type
File Changes
(4 files https://github.com/EnterpriseDB/mongo_fdw/pull/159/files)
- M expected/select.out https://github.com/EnterpriseDB/mongo_fdw/pull/159/files#diff-f367be6b780968d3eae8f3e8efd1c6d0e57d58ad45878e8c67b693904024ca5c (10)
- M mongo_fdw.c https://github.com/EnterpriseDB/mongo_fdw/pull/159/files#diff-9cb479006ae28d4734f487aa9a4d85f844ffaa102d9b938cec3f72fc937d7aba (32)
- M mongo_wrapper.c https://github.com/EnterpriseDB/mongo_fdw/pull/159/files#diff-d9456d13da4041407744b677dce21375c824f45a338309894fc07e18fcda0e88 (4)
- M mongo_wrapper_meta.c https://github.com/EnterpriseDB/mongo_fdw/pull/159/files#diff-caa26f9ea947479915bfded686d0730fb5f4f9ad6e13fa90f3d2f7133223383f (4)
Patch Links:
- https://github.com/EnterpriseDB/mongo_fdw/pull/159.patch
- https://github.com/EnterpriseDB/mongo_fdw/pull/159.diff
— Reply to this email directly, view it on GitHub https://github.com/EnterpriseDB/mongo_fdw/pull/159, or unsubscribe https://github.com/notifications/unsubscribe-auth/APOVKLPJVS4BS5BBBYTTCMLVCKYXVANCNFSM5R5QUFUA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
-- Jeevan Chalke
Senior Staff SDE, Database Architect and Manager,Product Development
edbpostgres.com
Why do you think that UTF8 bson type should be mapped to the name type at the PostgreSQL side? Can you please explain the same?
Following the commit log, when I debug with name type, your code does not process if type is UTF8. You can reprocedure it follow my commit log.
We can't assign a > int32 value to an int32 variable. And thus throwing an error is the correct way.
We get value by: int64 val = bson_iter_int64(it);
, so I think we need to compare it with INT64 type, why we compare it with INT32 type?
On Tue, Mar 29, 2022 at 2:09 PM Vu Manh Khieu @.***> wrote:
Why do you think that UTF8 bson type should be mapped to the name type at the PostgreSQL side? Can you please explain the same?
Following the commit log, when I debug with name type, your code does not process if type is UTF8. You can reprocedure it follow my commit log.
Yes. The name type is mapped ONLY with ObjectId BSON type and UTF8 BSON type is mapped to TEXT type. So you need to define a foreign table with text type if you have UTF8 data on the mongo side. Supporting such cross types needs a detailed study and not just allowing utf8 data with name.
We can't assign a > int32 value to an int32 variable. And thus throwing an error is the correct way.
We get value by: int64 val = bson_iter_int64(it);, so I think we need to compare it with INT64 type, why we compare it with INT32 type?
The foreign table column type is int32. How can you store value greater than int32 into it?
— Reply to this email directly, view it on GitHub https://github.com/EnterpriseDB/mongo_fdw/pull/159#issuecomment-1081592560, or unsubscribe https://github.com/notifications/unsubscribe-auth/APOVKLOA4Q2CZLOWIYDWXQ3VCK6UFANCNFSM5R5QUFUA . You are receiving this because you commented.Message ID: @.***>
-- Jeevan Chalke
Senior Staff SDE, Database Architect and Manager,Product Development
edbpostgres.com