Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !2437

Closed
Created 12 years ago by Administrator@rootOwner
  • Report abuse
Report abuse

remove backticks that break Postgres for raw sql in backup create task

  • Overview 12
  • Commits 1
  • Changes 1

Created by: kyledrake

I don't think this will break MySQL, but I haven't tested. If it does, then this fix will have to be slightly better. I didn't have any problems running the script after making this change for PSQL.

Loading
Loading

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: riyad

    +1

    By Administrator on 2012-12-31T13:58:57 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: Bregor

    +1

    By Administrator on 2013-01-20T21:13:37 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: kyledrake

    FYI Travis failed because of a segfault I believe, not because of my change.

    By Administrator on 2013-01-21T02:46:58 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: erroric

    +1

    By Administrator on 2013-01-21T15:32:04 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: Philzen

    👍

    This is a serious issue and should be merged asap as well as backmerged into 4.1-stable.

    By Administrator on 2013-01-23T07:05:31 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: vsizov

    I don't think this will break MySQL, but I haven't tested - LOL

    By Administrator on 2013-01-23T09:34:15 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: kyledrake

    @vsizov I'm extremely confident that it will work just fine in mysql. Here is the one line change: https://github.com/gitlabhq/gitlabhq/pull/2437/files#L0R168

    By Administrator on 2013-01-23T18:21:52 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: Philzen

    The ``` sign is just mysql's wrapping sign to allow non-ANSI-table names (i.e. multi-word table name containing spaces or equalling a keyword). Due to lack of an ER-diagramm or such at hand i just checked my own DB (gitlab 4.1), see below.

    The table name keys is actually a showstopper here: MySql reserved words

    gitlabhq_production=# \d
                       List of relations
     Schema |           Name            |   Type   | Owner  
    --------+---------------------------+----------+--------
     public | events                    | table    | gitlab
     public | events_id_seq             | sequence | gitlab
     public | groups                    | table    | gitlab
     public | groups_id_seq             | sequence | gitlab
     public | issues                    | table    | gitlab
     public | issues_id_seq             | sequence | gitlab
     public | keys                      | table    | gitlab
     public | keys_id_seq               | sequence | gitlab
     public | merge_requests            | table    | gitlab
     public | merge_requests_id_seq     | sequence | gitlab
     public | milestones                | table    | gitlab
     public | milestones_id_seq         | sequence | gitlab
     public | namespaces                | table    | gitlab
     public | namespaces_id_seq         | sequence | gitlab
     public | notes                     | table    | gitlab
     public | notes_id_seq              | sequence | gitlab
     public | projects                  | table    | gitlab
     public | projects_id_seq           | sequence | gitlab
     public | protected_branches        | table    | gitlab
     public | protected_branches_id_seq | sequence | gitlab
     public | schema_migrations         | table    | gitlab
     public | services                  | table    | gitlab
     public | services_id_seq           | sequence | gitlab
     public | snippets                  | table    | gitlab
     public | snippets_id_seq           | sequence | gitlab
     public | taggings                  | table    | gitlab
     public | taggings_id_seq           | sequence | gitlab
     public | tags                      | table    | gitlab
     public | tags_id_seq               | sequence | gitlab
     public | users                     | table    | gitlab
     public | users_id_seq              | sequence | gitlab
     public | users_projects            | table    | gitlab
     public | users_projects_id_seq     | sequence | gitlab
     public | web_hooks                 | table    | gitlab
     public | web_hooks_id_seq          | sequence | gitlab
     public | wikis                     | table    | gitlab
     public | wikis_id_seq              | sequence | gitlab

    Sorry i'm a ruby-noob, but if somebody simply could change this code to use an "escape sign" variable and concatenate the SQL from that. That variable needs to be " for PostgreSql and ``` for MySql.

    Cheers - Phil

    By Administrator on 2013-01-23T23:17:23 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: riyad

    @Philzen awesome, thanks for the explanation. 👍

    By Administrator on 2013-01-24T15:24:54 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: Philzen

    Welcome - any progress on this? I reckon if the RoR-DB-Access Wrappers were used here to generate the SQL it will be fine straightaway w/o the need to introduce another if/else in order to set the appropriate table name escaping character.

    If somebody doesn't pick this up soon i'll have to learn ruby myself and fix it (which will presumably end up in really awful ruby beginners' code ;) )

    By Administrator on 2013-02-25T18:05:49 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: Philzen

    Guess this can be closed now, with #3217 in place. Cheers @chrislawlor !

    By Administrator on 2013-03-18T06:26:35 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: Razer6

    Already fixed and whole Backup/restore refactored so this is outdated. @randx Please close

    By Administrator on 2013-04-06T18:41:50 (imported from GitLab project)

  • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
Please register or sign in to reply
0 Assignees
Assign to
0 Reviewers
Request review from
Milestone
No milestone
None
None
Time tracking
0
Labels
None
Assign labels
  • No matching results
  • Manage project labels
Lock merge request
Unlocked
participants
Reference:
Source branch: github/fork/kyledrake/fix_backup_create_for_postgres

    0 pending comments