Jump to content


MySQL5 and MKPortal


4 replies to this topic

#1 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 11 May 2006 - 07:30 PM

"Navigation Links" management

There is a MySQL5 compatibility issue with the "Navigation Links" management which produces an error like this when you try to add or edit a link.

ERROR: Database error.
Cannot execute the query: INSERT INTO mkp_mainlinks (icon, title, url, type, target) VALUES ('', 'test', 'www.an-corp.us', '2', '') 
MySql Error returned: Incorrect integer value: '' for column 'target' at row 1 
MySql Error code: 1366
The MySQL issue is described here...
http://bugs.mysql.com/bug.php?id=18551

To fix this issue...

FIND in mkportal/admin/ad_nav.php (function update_link):
$target = $mkportals->input['target'];
ADD BELOW:
	//MySQL5 patch
	if ($target != 1) {
		$target = 0;
	}
	//end MySQL5 patch
Original bug report here...
http://www.mkportal....ead.php?p=75649


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#2 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 11 May 2006 - 07:32 PM

SMF Board News Block
patches by Meo.
Original post: http://www.mkportal....read.php?t=9654

This is the patch to work Mkportal + SMF 1.1 + MySql 5.0.x

Warning, before to apply this patch be sure your SMF board is patched to work with MySql 5.
http://www.simplemachines.org/community/in...p?topic=55616.0

1)edit file:
mkportal/admin/ad_blocks.php
find line:
$DB->query("INSERT INTO mkp_blocks(file, title) VALUES('$file', '$title')");
substitute with:
$DB->query("INSERT INTO mkp_blocks(file, title, content) VALUES('$file', '$title', '')");
2) edit file:
mkportal/include/SMF/smf_board_functions.php
find line:
FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b
substitute with:
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
3)find line:
FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m, {$db_prefix}boards AS b
substitute with:
FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m, {$db_prefix}boards AS b)



Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#3 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 11 May 2006 - 09:12 PM

vB Board News Block

FIND in /mkportal/include/VB/vb_board_functions.php (function get_board_news):
FROM " . TABLE_PREFIX . "post AS post, " . TABLE_PREFIX . "thread AS thread
REPLACE WITH:
FROM (" . TABLE_PREFIX . "post AS post, " . TABLE_PREFIX . "thread AS thread)



Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#4 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 12 May 2006 - 09:30 AM

Poll Block

FIND in /mkportal/include/IPB/ipb_board_functions.php (function get_poll_active):
FROM ibf_topics t, ibf_polls p
REPLACE WITH:
FROM (ibf_topics t, ibf_polls p)
This describes the issue...

Quote

Previously, the comma operator (,) and JOIN both had the same precedence, so the join expression t1, t2 JOIN t3 was interpreted as ((t1, t2) JOIN t3). Now JOIN has higher precedence, so the expression is interpreted as (t1, (t2 JOIN t3)). This change affects statements that use an ON clause, because that clause can refer only to columns in the operands of the join, and the change in precedence changes interpretation of what those operands are.

Example:

CREATE TABLE t1 (i1 INT, j1 INT);
CREATE TABLE t2 (i2 INT, j2 INT);
CREATE TABLE t3 (i3 INT, j3 INT);
INSERT INTO t1 VALUES(1,1);
INSERT INTO t2 VALUES(1,1);
INSERT INTO t3 VALUES(1,1);
SELECT * FROM t1, t2 JOIN t3 ON (t1.i1 = t3.i3);

Previously, the SELECT was legal due to the implicit grouping of t1,t2 as (t1,t2). Now the JOIN takes precedence, so the operands for the ON clause are t2 and t3. Because t1.i1 is not a column in either of the operands, the result is an Unknown column 't1.i1' in 'on clause' error. To allow the join to be processed, group the first two tables explicitly with parentheses so that the operands for the ON clause are (t1,t2) and t3:

SELECT * FROM (t1, t2) JOIN t3 ON (t1.i1 = t3.i3);

Alternatively, avoid the use of the comma operator and use JOIN instead:

SELECT * FROM t1 JOIN t2 JOIN t3 ON (t1.i1 = t3.i3);

This change also applies to statements that mix the comma operator with INNER JOIN, CROSS JOIN, LEFT JOIN, and RIGHT JOIN, all of which now have higher precedence than the comma operator.

from http://dev.mysql.com....0/en/join.html



Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#5 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 19 February 2007 - 09:22 AM

Update: Version M1.1.1 is compatible with MySQL5.


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users