can't open db when path length extends 512 characters (on linux)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

can't open db when path length extends 512 characters (on linux)

Nir Paz
Hi All,

I get the next error: SQLITE_CANTOPEN when calling sqlite3_open_v2 with
filename exceeding 512 characters.

Linux doesn't have that limit, my thought is to change the define of
MAX_PATHNAME, is there a better option?

Thanks,
Nir
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: can't open db when path length extends 512 characters (on linux)

Dan Kennedy-4
On 01/31/2017 12:48 AM, Nir Paz wrote:
> Hi All,
>
> I get the next error: SQLITE_CANTOPEN when calling sqlite3_open_v2 with
> filename exceeding 512 characters.
>
> Linux doesn't have that limit, my thought is to change the define of
> MAX_PATHNAME, is there a better option?

I don't think there is a better way to do that. Define MAX_PATHNAME to
something and see how it goes.

There is one very subtle problem that we know of:

    http://www.sqlite.org/src/artifact/ff1232b3088a3?ln=2771-2775

This means that if database page size is smaller in bytes than the
filenames, you might find that following recovery from a crash or power
failure occurs during COMMIT of a multi-file transaction in rollback
mode a some of the databases written to have committed and some rolled
back the transaction. As can happen in wal mode.

Dan.


_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: can't open db when path length extends 512 characters (on linux)

Jan Nijtmans
2017-01-30 19:37 GMT+01:00 Dan Kennedy:

> On 01/31/2017 12:48 AM, Nir Paz wrote:
>> Linux doesn't have that limit, my thought is to change the define of
>> MAX_PATHNAME, is there a better option?
>
> I don't think there is a better way to do that. Define MAX_PATHNAME to
> something and see how it goes.
>
> There is one very subtle problem that we know of:
>
>    http://www.sqlite.org/src/artifact/ff1232b3088a3?ln=2771-2775

Well, starting with this commit:
    <http://www.sqlite.org/src/info/2e8a9ca9d3d6efdd>
the default page size is now 4096. So I don't think the risk is
really big. Upgrading to 1024 (or even 4096) should be
no problem.

See also:
    <https://www.sqlite.org/pragma.html#pragma_page_size>

Regards,
       Jan Nijtmans
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: can't open db when path length extends 512 characters (on linux)

Rowan Worth-2
On 31 January 2017 at 17:32, Jan Nijtmans <[hidden email]> wrote:

> 2017-01-30 19:37 GMT+01:00 Dan Kennedy:
> > On 01/31/2017 12:48 AM, Nir Paz wrote:
> >> Linux doesn't have that limit, my thought is to change the define of
> >> MAX_PATHNAME, is there a better option?
> >
> > I don't think there is a better way to do that. Define MAX_PATHNAME to
> > something and see how it goes.
> >
> > There is one very subtle problem that we know of:
> >
> >    http://www.sqlite.org/src/artifact/ff1232b3088a3?ln=2771-2775
>
> Well, starting with this commit:
>     <http://www.sqlite.org/src/info/2e8a9ca9d3d6efdd>
> the default page size is now 4096.
>

That only applies to new databases though. The millions of files created
before this change will still use their original page size (unless
explicitly changed via PRAGMA page_size + VACUUM).

-Rowan
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users