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

Creating a database named 0 gives a fatal error #14314

Closed
nulll-pointer opened this Issue May 21, 2018 · 8 comments

Comments

Projects
None yet
4 participants
@nulll-pointer
Contributor

nulll-pointer commented May 21, 2018

Steps to reproduce

  1. Click new database in the navigation.
  2. Enter 0 in the database name field and submit.

Expected behaviour

Should create database 0/give an sql error.

Actual behaviour

Gives a fatal error

Note: I'm not sure about the expected behaviour, because, creating a database 00 gives error in mysql, but not in phpmyadmin, maybe because it uses backquotes while inserting.

Server configuration

ubuntu 16.04

Web server:
Apache/2.4.29

Database:
mariadb 10.1.30

PHP version:
7.1.14

phpMyAdmin version:
5.0.0-dev

@williamdes

This comment has been minimized.

Member

williamdes commented May 21, 2018

Issue confirmed in PMA 4.7.9
If I remember, there was a similar issue somewhere in PMA.It was related to using == instead of ===
This is maybe why 0 fails : https://stackoverflow.com/a/2220571/5155484 or https://medium.com/@daveford/javascript-thinks-0-equals-empty-string-e40be4c7466a

Demo server

selection_023

@rijaspk

This comment has been minimized.

Contributor

rijaspk commented May 23, 2018

The issue occurred due to using == instead of ===.
I will try to fix this.

rijaspk added a commit to rijaspk/phpmyadmin that referenced this issue May 23, 2018

Creating a database named 0 gives a fatal error-issue solved
Issue  phpmyadmin#14314

Signed-off-by: Rijas Ahammed PK <rijaspk5195@gmail.com>
@williamdes

This comment has been minimized.

Member

williamdes commented Jun 2, 2018

@rijaspk did you open a pull request ?

@ibennetch

This comment has been minimized.

Member

ibennetch commented Jun 3, 2018

The error I get is:

{
    "pma_version": "4.8.2-dev",
    "browser_name": "FIREFOX",
    "browser_version": "60.0",
    "user_os": "Mac",
    "server_software": "Apache/2.4.25 (Debian)",
    "user_agent_string": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Firefox/60.0",
    "locale": "en",
    "configuration_storage": "enabled",
    "php_version": "7.2.5-1+0~20180505045740.21+stretch~1.gbpca2fa6",
    "exception_type": "js",
    "exception": {
        "mode": "stack",
        "name": "TypeError",
        "message": "dbStruct_url is undefined",
        "stack": [
            {
                "func": "?",
                "line": "125",
                "column": "17",
                "uri": "index.php?v=4.8.2-dev",
                "scriptname": "index.php"
            },
            {
                "func": "u",
                "line": "2",
                "column": "27452",
                "uri": "index.php?v=4.8.2-dev",
                "scriptname": "index.php"
            },
            {
                "func": "fireWith",
                "line": "2",
                "column": "28202",
                "uri": "index.php?v=4.8.2-dev",
                "scriptname": "index.php"
            },
            {
                "func": "k",
                "line": "2",
                "column": "77649",
                "uri": "index.php?v=4.8.2-dev",
                "scriptname": "index.php"
            },
            {
                "func": "n/<",
                "line": "2",
                "column": "79907",
                "uri": "index.php?v=4.8.2-dev",
                "scriptname": "index.php"
            }
        ],
        "uri": "index.php?"
    },
    "script_name": "index.php",
    "microhistory": nul

This affects both QA_4_8 and master.

@rijaspk

This comment has been minimized.

Contributor

rijaspk commented Jun 4, 2018

@williamdes Apologies, Actually what happened is I referred to this issue in my commit by mistake. I didn't intend to create a pull request because the issue still there.

@nulll-pointer

This comment has been minimized.

Contributor

nulll-pointer commented Jun 8, 2018

If no one is working on this, I'll?

@williamdes

This comment has been minimized.

Member

williamdes commented Jun 8, 2018

@nulll-pointer +1

nulll-pointer added a commit to nulll-pointer/phpmyadmin that referenced this issue Jun 15, 2018

Fix for phpmyadmin#14314, error while naming a database '0'
Signed-Off-By: Lakshay arora <arora.lakshya123@gmail.com>

@ibennetch ibennetch self-assigned this Jun 29, 2018

ibennetch added a commit that referenced this issue Jun 29, 2018

Fix for #14314, error while naming a database '0'
Signed-Off-By: Lakshay arora <arora.lakshya123@gmail.com>

ibennetch added a commit that referenced this issue Jun 29, 2018

ChangeLog entry for pull request #14398, fixing bug #14314
This change was cherry-picked to commit
b0ec6b6

Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
@ibennetch

This comment has been minimized.

Member

ibennetch commented Jun 29, 2018

Fixed with the pull request #14398 from @nulll-pointer. The commit was cherry-picked to QA_4_8 as b0ec6b6.

Thank you for reporting the issue! This will be fixed as part of the next release of phpMyAdmin.

@ibennetch ibennetch closed this Jun 29, 2018

@ibennetch ibennetch added this to the 4.8.3 milestone Jun 29, 2018

@ibennetch ibennetch added the bug label Jun 29, 2018

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