Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL_CALC_FOUND_ROWS still runs in MySQL 8.0.29

Status
Not open for further replies.

dylim

Programmer
Dec 12, 2001
106
0
16
PH
Hi Guys,

As per MySQL documentation, SQL_CALC_FOUND_ROWS and FOUND_ROWS() has been deprecated since MySQL 8.0.17.

How come I can still use it in MySQL 8.0.29?

Comments please? Or maybe I missed a newer memo on this?
 

Depreciated doesn't mean removed. It will be removed in a future version. Think of it as a warning that you should refactor your code if you do use it.


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
MarkSweetLand,

Hi. Thanks for your reply. Noted on this.

I stumbled into these because I encountered a very weird error using SELECT COUNT(*)....

This I believe is the offending code:

[pre]select count(*) as totrecs from pihdr a left join supplier b on
a.supplierid=b.id left join ewtax c on a.ewtaxid=c.id left join jthdr d
on a.jthdrid=d.id
[/pre]

In my ODBC trace, this is what I found:

[pre]DIAG [01000] [MySQL][ODBC 8.0(w)Driver][mysqld-8.0.30]The number of attributes is larger than the number of attribute values provided (500)
[/pre]

That is why I tried substituting it with:

[pre]select SQL_CALC_FOUND_ROWS * from pihdr a left join supplier b on
a.supplierid=b.id left join ewtax c on a.ewtaxid=c.id left join jthdr d
on a.jthdrid=d.id

select FOUND_ROWS() as totrecs[/pre]

My code works with MySQL ODBC 8.0.30 and MySQL Server 5.7.37 perfectly... when I run it with MySQL ODBC 8.0.30 and
MySQL Server 8.0.30.. that is where the error appear...


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top