Skip to content

Conversation

@zhangyongding
Copy link

No description provided.

@zhangyongding zhangyongding changed the title 解决varchar插入中文被截断的问题 Resolve the issue of Chinese truncation during varchar insertion Apr 30, 2024
"unsafe"
)

func TestBufferLen_IsNull(t *testing.T) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see that you added test as I requested here #182 (comment) , but I was asking for a different test. Your test does not prove that there is a problem with current code.

Perhaps if you adjust TestMSSQLTypes

func TestMSSQLTypes(t *testing.T) {
or TestMSSQLTextColumnParamTypes
func TestMSSQLTextColumnParamTypes(t *testing.T) {
or any other existing test, then I can be convinced.

Thank you.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added test

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added test

Your test is wrong. For any Unicode values you should be using nvarchar instead of varchar type.

I just added this commit 25af894#diff-fa7d078a77ac77b6c32112f98183f4a221d30d0f460e50456b2ba995efaf0f23R675 with proper tests, and they all pass here.

I will not review your PR, because I don't believe it is required. Nothing is broken.

Alex

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue does not occur in all databases, only some databases exist. I think setting the size to p.size is the correct approach

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue does not occur in all databases, only some databases exist.

If you have a way for me to reproduce the issue, I will look at it again.

I think setting the size to p.size is the correct approach

I disagree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants