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
  • Issues
  • #308

Closed
Open
Created Jan 19, 2012 by Administrator@rootOwner

Invalid SQL line

Created by: rgirardRev

I am running Mysql for this, and when accessing CommitsController#show, I was getting the following error:

ActionView::Template::Error (Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nu ll)' at line 1: SELECT notes.* FROM notes WHERE notes.project_id = 23 AND notes.noteable_id = 'b7898c8df4ad1bf9db37b1e278fd3b5ae9488b1b' AND notes.noteable_type = 'Commit' AND (line_code not null)):

It appears you cannot just do "variable not null" in MySQL. It should be "variable IS not null". This should also work with SQLite.

Relavant update should be in app/models/project.rb, line 174:

notes.where(:noteable_id => commit.id, :noteable_type => "Commit").where("line_code is not null")

Assignee
Assign to
Time tracking