Special characters in identifiers

[expired user #10580]'s profile image [expired user #10580] posted 7 years ago in General Permalink

Hi.

Just love HeidiSQL. Thank you!

I noticed a couple of things. Spaces in database names cause issues when trying to open those databases. Also commas in field names cause issues when creating indexes for those fields. So guessing identifiers need to be better protected, so that special characters in them (which are valid) don't cause issues.

ref: https ://mariadb .com/kb/en/mariadb/identifier-names/

I'm connecting to MariaDB via localhost. Using Heidi 9.4.0.5151

I know, for now I just have to rename a few things. But am integrated into other environments and that's harder than it looks.

-- HJ

ansgar's profile image ansgar posted 7 years ago Permalink

Please say which problem or error message you exactly get. HeidiSQL tries to do the best to allow all kinds of characters in identifiers, as it mostly uses backticks for quoting. There are only some few exceptions where HeidiSQL does not quote identifiers, and even then there is an internal regular expression which checks for the characters which need quoting.

kalvaro's profile image kalvaro posted 7 years ago Permalink

@Sky Out of curiosity... Have you disabled sql_quote_show_create in your server?

[expired user #10580]'s profile image [expired user #10580] posted 7 years ago Permalink

@Sky Out of curiosity... Have you disabled [sql_quote_show_create](https: //www.heidisql. com/forum.php?t=7802#p7802) in your server?

No, have not.

[expired user #10580]'s profile image [expired user #10580] posted 7 years ago Permalink

Please say which problem or error message you exactly get. HeidiSQL tries to do the best to allow all kinds of characters in identifiers, as it mostly uses backticks for quoting. There are only some few exceptions where HeidiSQL does not quote identifiers, and even then there is an internal regular expression which checks for the characters which need quoting.

You bet. Here you go.


A) Here is how I'm seeing the problem for a space in a database name:

Step 1 - First create a database with a space in the name (using command line mysql tool):

mysql -u root -p  
MariaDB [(none)]> create database `two words`;

Note this is: create database (back tick)two words(back tick)(semi-colon)

Step 2 - open HeidiSQL session

Session Manager: Databases pulldown: shows "two words" Check it, then click "Open"

Step 3 - Show the problem

Left pane - list of databases shows it as two databases like this:

two words

Step 4 - followthrough. Clicking each gives:

SQL Error (1049): Unknown database 'two'

and

SQL Error (1049): Unknown database 'words'

B) Here's how I'm seeing the index/key problem with a comma in a database field name:

Step 1 - Create field with a comma in it:

CREATE TABLE `foo,bar` (`oof,rab` INT NULL) COLLATE='utf8_general_ci' ENGINE=InnoDB;

Step 2 - Create an index for this field:

In table structure pane (middle,right) right click on oof,rab field and select create new index: key click Save

Step 3 - View problem:

View Indexes tab. Open key oof,rab in view indexes tab, and it shows two components:

oof  
rab
[expired user #10580]'s profile image [expired user #10580] posted 7 years ago Permalink

BTW, and while you're at it, about a month ago I noticed that single and double quotes in field names also had similar issues.

I had fields name something like size' and size" (to mean size in feet, and size in inches).

Beautiful day here, hope it's nice for you there.

ansgar's profile image ansgar posted 7 years ago Permalink

What you described in A) was fixed by me in r5076 from May 2016. See this thread. Databases were previously split by space characters.

I can confirm the B) issue though. Will check that.

[expired user #10580]'s profile image [expired user #10580] posted 7 years ago Permalink

Apologies; thought I had the latest version on this box; now updated.

Getting the parsing straight can be a pain, I know. In my last project I finally created a worst case data-set for testing, and future testing, so I could be more sure things would go in and out of the user interface and databases correctly no matter what unicode was used. Sounds easy, but was hard to get 100% correct and to keep it that way as development proceeded. I admire what you've done, especially after reading through your commit log.

[expired user #10580]'s profile image [expired user #10580] posted 7 years ago Permalink

BTW, I would send you a donation, but I got rid of PayPal accouonts a couple of years ago. Just too many problems with them. They started as a good company, but then all the good people got rich and left. Now they stink. So switched to Stripe.com which seems to have a much better payment engine. Here are a few ideas to look at: https://duckduckgo.com/?q=moving+from+paypal+to+stripe&t=ffab&ia=web

ansgar's profile image ansgar posted 7 years ago Permalink

I have just created a Stripe account for anse at heidisql.com. And I see quite a bit of documentation, but it looks quite usable and developer-friendly so far.

[expired user #10580]'s profile image [expired user #10580] posted 7 years ago Permalink

Not sure how your webs site is set up. Do any of these help? https://stripe.com/docs/libraries#third-party-plugins. OR https://stripe.com/docs/libraries#third-party-plugins

(I set it up previously for a site w/ the php api.)

I'm not an expert at this, but will help you as best I can so feel free to ask. Also they have pretty good customer service I think.

[expired user #10580]'s profile image [expired user #10580] posted 7 years ago Permalink

And possibly this: https://www.wpkube.com/setup-stripe-accept-payments-wordpress/

Please login to leave a reply, or register at first.