Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
b14a6221
Commit
b14a6221
authored
18 years ago
by
Neil Drumm
Browse files
Options
Downloads
Patches
Plain Diff
#74997
by dww, add db_table_exists()
parent
cfaa4b5f
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
includes/database.mysql.inc
+7
-0
7 additions, 0 deletions
includes/database.mysql.inc
includes/database.mysqli.inc
+7
-0
7 additions, 0 deletions
includes/database.mysqli.inc
includes/database.pgsql.inc
+7
-0
7 additions, 0 deletions
includes/database.pgsql.inc
with
21 additions
and
0 deletions
includes/database.mysql.inc
+
7
−
0
View file @
b14a6221
...
@@ -364,6 +364,13 @@ function db_unlock_tables() {
...
@@ -364,6 +364,13 @@ function db_unlock_tables() {
db_query
(
'UNLOCK TABLES'
);
db_query
(
'UNLOCK TABLES'
);
}
}
/**
* Check if a table exists.
*/
function
db_table_exists
(
$table
)
{
return
db_num_rows
(
db_query
(
"SHOW TABLES LIKE '{"
.
db_escape_table
(
$table
)
.
"}'"
));
}
/**
/**
* @} End of "ingroup database".
* @} End of "ingroup database".
*/
*/
...
...
This diff is collapsed.
Click to expand it.
includes/database.mysqli.inc
+
7
−
0
View file @
b14a6221
...
@@ -366,6 +366,13 @@ function db_unlock_tables() {
...
@@ -366,6 +366,13 @@ function db_unlock_tables() {
db_query
(
'UNLOCK TABLES'
);
db_query
(
'UNLOCK TABLES'
);
}
}
/**
* Check if a table exists.
*/
function
db_table_exists
(
$table
)
{
return
db_num_rows
(
db_query
(
"SHOW TABLES LIKE '{"
.
db_escape_table
(
$table
)
.
"}'"
));
}
/**
/**
* @} End of "ingroup database".
* @} End of "ingroup database".
*/
*/
...
...
This diff is collapsed.
Click to expand it.
includes/database.pgsql.inc
+
7
−
0
View file @
b14a6221
...
@@ -343,6 +343,13 @@ function db_unlock_tables() {
...
@@ -343,6 +343,13 @@ function db_unlock_tables() {
db_query
(
'COMMIT'
);
db_query
(
'COMMIT'
);
}
}
/**
* Check if a table exists.
*/
function
db_table_exists
(
$table
)
{
return
db_num_rows
(
db_query
(
"SELECT relname FROM pg_class WHERE relname = '{"
.
db_escape_table
(
$table
)
.
"}'"
));
}
/**
/**
* Verify if the database is set up correctly.
* Verify if the database is set up correctly.
*/
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment