Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7865895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:13:21+00:00 2026-06-03T00:13:21+00:00

I have a very large and complex MySQL query that gets run from a

  • 0

I have a very large and complex MySQL query that gets run from a Node.JS process, but I am getting a strange error.

The query is about 150 lines of SQL code, so I’m not going to include it, but I know it’s good. It is written in the JS source code as a variable with \ at the end of the each line to continue the string. If I copy the SQL from the source and remove the \s it runs perfectly. However, when I run it through the app, I get the dreaded:

MySQL: 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 '' at line 1

” anywhere in the huge single line that is my query – thanks MySQL.

When I get the app to output the SQL to the screen and I copy and paste that, I get the same error in MySQL. I decided to run the 2 queries (source when \ removed and the output) through diff, and the only difference is the line breaks – the source has line breaks, and the output doesn’t. I should also note, that simpler queries in this app do work, so there’s something in this query causing this.

What possible change could be happening to the MySQL query when the line breaks are removed? Is there some limit of lines or spaces that I am unaware of? My understanding is that MySQL ignores all line breaks and whitespace. Is this not true? Could someone point me in the right direction to trouble shoot this?

There were some comments that I removed, there were some blank lines that I removed, I converted the tabs to spaces.. I’m out of ideas.

Thanks,

whiteatom

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:13:22+00:00Added an answer on June 3, 2026 at 12:13 am

    Missed a comment in the query. I was using the — MySQL comment syntax which comments to the end of the line. When the line breaks are removed – the query was terminated at that comment.

    Thanks for looking; hope this helps someone else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very complex MySQL query that includes use of the same subquery
So, we have a very large and complex website that requires a lot of
I have a very large image that I would like to show a 200x200px
I have a very large code base that contains extensive unit tests (using CppUnit).
I have a very large file that looks like this (see below). I have
I have a very large codebase (read: thousands of modules) that has code shared
I have a very large possible data set that I am trying to visualize
I have a very large, complex (million+ LOC) Windows application written in C++. We
I have to write a very large test suite for a complex set of
I have written a very complex database migration script in Groovy, that runs just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.