Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
9b71a5c2
Unverified
Commit
9b71a5c2
authored
Jul 11, 2020
by
Scott
Committed by
GitHub
Jul 11, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #758 from pupi1985/patch-132
Fix database overflow issue when trying to insert content words
parents
0e3a8c76
78b7842a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
maxima.php
qa-include/db/maxima.php
+1
-0
post-create.php
qa-include/db/post-create.php
+5
-1
No files found.
qa-include/db/maxima.php
View file @
9b71a5c2
...
@@ -48,6 +48,7 @@ $maximaDefaults = array(
...
@@ -48,6 +48,7 @@ $maximaDefaults = array(
'QA_DB_MAX_BLOB_FILE_NAME_LENGTH'
=>
255
,
'QA_DB_MAX_BLOB_FILE_NAME_LENGTH'
=>
255
,
'QA_DB_MAX_META_TITLE_LENGTH'
=>
40
,
'QA_DB_MAX_META_TITLE_LENGTH'
=>
40
,
'QA_DB_MAX_META_CONTENT_LENGTH'
=>
8000
,
'QA_DB_MAX_META_CONTENT_LENGTH'
=>
8000
,
'QA_DB_MAX_WORD_COUNT'
=>
255
,
// The field is currently a TINYINT so it shouldn't exceed this value
// How many records to retrieve for different circumstances. In many cases we retrieve more records than we
// How many records to retrieve for different circumstances. In many cases we retrieve more records than we
// end up needing to display once we know the value of an option. Wasteful, but allows one query per page.
// end up needing to display once we know the value of an option. Wasteful, but allows one query per page.
...
...
qa-include/db/post-create.php
View file @
9b71a5c2
...
@@ -166,8 +166,12 @@ function qa_db_contentwords_add_post_wordidcounts($postid, $type, $questionid, $
...
@@ -166,8 +166,12 @@ function qa_db_contentwords_add_post_wordidcounts($postid, $type, $questionid, $
{
{
if
(
count
(
$wordidcounts
))
{
if
(
count
(
$wordidcounts
))
{
$rowstoadd
=
array
();
$rowstoadd
=
array
();
foreach
(
$wordidcounts
as
$wordid
=>
$count
)
foreach
(
$wordidcounts
as
$wordid
=>
$count
)
{
if
(
$count
>
QA_DB_MAX_WORD_COUNT
)
{
$count
=
QA_DB_MAX_WORD_COUNT
;
}
$rowstoadd
[]
=
array
(
$postid
,
$wordid
,
$count
,
$type
,
$questionid
);
$rowstoadd
[]
=
array
(
$postid
,
$wordid
,
$count
,
$type
,
$questionid
);
}
qa_db_query_sub
(
qa_db_query_sub
(
'INSERT INTO ^contentwords (postid, wordid, count, type, questionid) VALUES #'
,
'INSERT INTO ^contentwords (postid, wordid, count, type, questionid) VALUES #'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment