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 9203071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:23:41+00:00 2026-06-17T23:23:41+00:00

I have a query: SELECT * FROM tb WHERE id=1 AND sleep(CAST((SELECT ‘a’ REGEXP

  • 0

I have a query:

SELECT * FROM tb WHERE id=1 
AND 
sleep(CAST((SELECT 'a' REGEXP '^[n-z]') AS signed) * 15);

I’m trying to understand how it works.

1) SELECT * FROM tb WHERE id=1 # that’s simple no explanation needed

2) sleep(CAST((SELECT 'a' REGEXP '^[n-z]') AS signed) * 15); # Here it’s a knotty problem
for me.

I believe things are: sleep for (the result of –> CAST((SELECT ‘a’ REGEXP ‘^[n-z]’) AS signed) multiplied by 15.

My concerns are:

  • CAST is a function to convert (for instance from string to date) but here it is used to convert a string in a signed number ..is that correct?

  • REGEXP, I believe is used this way: (SELECT 'a' REGEXP '^[n-z]') returns 0 (zero) so multiplied by 15 is always 0. But (SELECT 'p' REGEXP '^[n-z]') returns 1 so in this case the DBMS sleeps for 15 sec.

So, now the final question is:

  • if tb has only one record whose name is ‘bob’, is the database going to pause for 15 sec?
  • 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-17T23:23:41+00:00Added an answer on June 17, 2026 at 11:23 pm

    if tb has only one record whose name is ‘bob’, is the database going to pause for 15 sec?

    No, with this query the database is never gonna pause because CAST((SELECT 'a' REGEXP '^[n-z]') AS signed) * 15 always returns 0, totally independent from your records: It does not use any column from the table, ‘a’ is a string literal.

    But other than that, you analyzed it correct. The query as you shown it does not make any sense.

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

Sidebar

Related Questions

I have a query SELECT * FROM tblMyTable that returns these results: ID |
Lets have a simple query: SELECT myfield FROM mytable WHERE criteria The above query
I have query like: SELECT * FROM uni_customer WHERE mobile REGEXP '^(1[3,4,5,8]){1}\\d{9}$' But there
I have been trying to add data from my ajax query that returns json
I have this query: SELECT * From checkfinale where AssociateID = 51 AND `CompletedDate`
i have sql query select * from Roles Join Users On Roles.Role=Users.RoleId it return
I have this query: SELECT * FROM sample INNER JOIN test ON sample.sample_number =
I have a query to select from another sub-query select. While the two queries
Let's say I have this query: select * from table1 r where r.x =
Hi guys I am having issue I have this query: SELECT * FROM useraccount

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.