You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Thiruvalluvan M. G. (JIRA)" <ji...@apache.org> on 2018/12/28 14:38:00 UTC

[jira] [Assigned] (AVRO-1488) FileBufferCopyIn::seek does not work on Windows systems

     [ https://issues.apache.org/jira/browse/AVRO-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thiruvalluvan M. G. reassigned AVRO-1488:
-----------------------------------------

    Assignee: Ben Webb

> FileBufferCopyIn::seek does not work on Windows systems
> -------------------------------------------------------
>
>                 Key: AVRO-1488
>                 URL: https://issues.apache.org/jira/browse/AVRO-1488
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: c++
>    Affects Versions: 1.7.6
>         Environment: Win32
>            Reporter: Ben Webb
>            Assignee: Ben Webb
>            Priority: Major
>              Labels: easyfix, patch
>         Attachments: win32-seek.patch
>
>
> FileBufferCopyIn::seek() on a Windows system generally fails with an exception. This is because it is implemented as
> if (::SetFilePointer(...)  != INVALID_SET_FILE_POINTER) throw(...)
> This test is the opposite of what it should be! SetFilePointer returns the new pointer on success (sort of), just like lseek. See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365541%28v=vs.85%29.aspx
> The fix is pretty simple - reverse the test. But apparently INVALID_SET_FILE_POINTER is also a valid file pointer (that's not confusing at all - thanks Microsoft!) so you also need to check the Windows error indicator to make absolutely sure. I'll attach a patch.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)