New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing case in table name #1200

Closed
zentaz opened this Issue Oct 27, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@zentaz
Copy link

zentaz commented Oct 27, 2017

Details for the issue

Hi,

When trying to change case in table name I get an error message saying that table already exists.
I assume this is a bug?

dbb_rename_bug

Thanks!
Richard

Useful extra information

I'm opening this issue because:

  • DB4S is crashing
  • [ x ] DB4S has a bug
  • DB4S needs a feature
  • DB4S has another problem

I'm using DB4S on:

  • [ x ] Windows: ( version:10_ )
  • Linux: ( distro: ___ )
  • Mac OS: ( version: ___ )
  • Other: ___

I'm using DB4S version:

  • [ x ] 3.10.1
  • 3.10.0
  • 3.9.1
  • Other: ___

I have also:

@chrisjlocke

This comment has been minimized.

Copy link
Contributor

chrisjlocke commented Oct 27, 2017

Not 'strictly' a bug, but a quirk! ;) Table names in SQLite are case insensitive, so if you want to change the case, change the name also (eg, DazData to dazdataa, then dazdataa back to dazdata)

Guess DB4S could do similar - when changing a name, change it to something random, then back again to what the user wanted.

I thought DOS would have the same issue, but Win 10 handles it correctly.

image

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Oct 27, 2017

Hmmm, wonder how well foreign keys referencing the table-being-renamed would go with that approach. Might need to do something with pragma's to disable foreign key checking until the renaming is completed.

@zentaz

This comment has been minimized.

Copy link
Author

zentaz commented Oct 28, 2017

OK, will try that workaround. Thanks! :)

MKleusberg added a commit that referenced this issue Oct 31, 2017

Support renaming table to a name that's only differs in case
SQLite doesn't support this by itself, so we have to work around it.

See issue #1200.
@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Oct 31, 2017

I've just added this workaround to our code 😄 So with tomorrow's nightly build onwards, you don't have to this yourself anymore and changing the case in table names will "just work". Are you ok to give that a try and see if it's working for you, @zentaz?

@zentaz

This comment has been minimized.

Copy link
Author

zentaz commented Nov 1, 2017

Just tried the latest build, changing case works fine now. Thanks very much! :)

@chrisjlocke chrisjlocke closed this Nov 1, 2017

@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Nov 1, 2017

Cool, thanks for confirming 😄

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