Tagged articles
NULL handling
40 articles · Page 1 of 1
This article explains why MySQL unique indexes permit multiple NULL values due to SQL's three-valued logic, demonstrates how this breaks upsert statements and causes silent duplicates, compares behavior across databases, and presents solutions using NOT NULL constraints, generated columns, and functional indexes to enforce true uniqueness.
InnoDBMySQLNULL handling
0 likes · 16 min read

This article debunks the myth that HAVING requires GROUP BY, demonstrating advanced HAVING techniques including missing sequence detection, mode and median calculation, and NULL-aware grouping with concrete SQL examples and performance reasoning.
HAVING clauseNULL handlingSQL
0 likes · 13 min read

This article explores hidden pitfalls in Java's Collectors.toMap including duplicate key exceptions, null value handling limitations, null key behavior, and null list safety, providing practical workarounds like merge functions and Optional-based null handling for robust stream-to-map conversions.
Best PracticesCollectors.toMapDuplicate Keys
0 likes · 7 min read

This article walks through the rationale, common functions, and real‑world case studies of storing and querying JSON columns in a relational database, exposing issues with null handling, batch updates, and dynamic SQL generation, and presents step‑by‑step debugging and robust solutions.
Batch UpdateDynamic QueriesJSON
0 likes · 11 min read

This article explains the seven key differences between Java's primitive int and its wrapper Integer, covering default values, memory layout, comparison pitfalls, caching, autoboxing/unboxing, performance impact, and appropriate usage scenarios with concrete code examples and benchmarks.
AutoboxingIntegerJava
0 likes · 22 min read


ITPUBApr 6, 2026 · Backend Development
The article explains how treating the literal string "null" as an empty value can cause serious bugs in Java backend registration, database storage, and security checks, and provides concrete code examples and a sanitisation utility to prevent these issues.
BackendNULL handlinginput validation
0 likes · 7 min read

This article presents eight concrete rules for handling null values in Spring Boot 3 applications, illustrating common pitfalls with code snippets, explaining production‑impact risks, and offering best‑practice solutions such as using empty collections, explicit null checks, proper Optional usage, and consistent API design.
Best PracticesJavaNPE prevention
0 likes · 11 min read

This article explains how Java handles null and empty‑string comparisons with a.equals(b), Objects.equals(a, b), and the == operator, detailing the resulting return values, exception behavior, and the underlying source code logic.
JavaNULL handlingObjects.equals
0 likes · 7 min read

This article explains how a.equals(b) behaves with null and empty strings, compares it to Objects.equals, analyzes the underlying source code, and clarifies the difference between reference comparison (a==b) and logical equality (a.equals(b)) in Java.
Equals vs ==JavaNULL handling
0 likes · 5 min read

A literal string "null" used as a username can bypass null checks, pollute databases, confuse logs, introduce security risks, and break automation, but thorough server‑side validation, client checks, database constraints, and explicit logging can eliminate these hidden bugs.
DebuggingNULL handlingSecurity
0 likes · 5 min read

This article examines why excessive null‑checking clutters code, distinguishes when null is a valid response versus an error, and offers practical alternatives such as assertions, exceptions, returning empty collections, and the Null Object pattern to write cleaner, safer Java programs.
JavaNULL handlingassertions
0 likes · 7 min read

The article explains how treating the literal string "null" as an empty value can cause serious bugs in Java backend registration, demonstrates the issue with code examples, and provides practical input‑sanitizing and validation techniques to prevent such errors and related security risks.
NULL handlinginput validation
0 likes · 7 min read

COUNT(*), COUNT(1) and COUNT(column) may look similar, but they differ in how MySQL processes them, the rows they count, and performance implications, especially with NULL values and index usage; this article explains each form, cites official InnoDB behavior, and guides proper usage.
COUNTInnoDBMySQL
0 likes · 6 min read

A Python community member struggled with a pandas null check that produced incorrect results, and the discussion reveals why the diff_qty calculation can't be null and offers concise code fixes to correctly handle zero and null values in data processing.
NULL handlingPythoncode debugging
0 likes · 3 min read

This article explores Java's Optional class, explaining its intended purpose, proper usage patterns, common pitfalls, performance considerations, and detailed source code analysis, while comparing it to traditional null checks and demonstrating how methods like map, orElseThrow, and orElseGet behave in practice.
JavaNULL handlingOptional
0 likes · 10 min read

This article explains how Java's Objects.equals differs from the traditional a.equals(b) method, covering null and empty‑string scenarios, demonstrating safe comparisons without NullPointerExceptions, and includes a concise analysis of the underlying source code and the distinction between a==b and a.equals(b).
JavaNULL handlingObjects.equals
0 likes · 5 min read

This article examines why a MySQL InnoDB table with a unique index can still store duplicate rows—especially when indexed columns contain NULL values or when logical deletion is used—and presents several practical strategies such as adjusting delete status, adding timestamp or auxiliary ID fields, using hash columns, and leveraging proper bulk‑insert techniques to enforce uniqueness effectively.
Database DesignHashMySQL
0 likes · 13 min read

This article explains why a unique index in MySQL can still allow duplicate rows when indexed columns contain NULL, explores the challenges of adding unique indexes to logically deleted tables, and presents practical solutions such as incremental delete status, timestamps, extra IDs, hash fields, and proper batch insertion techniques.
Database DesignMySQLNULL handling
0 likes · 13 min read

This article explains why a MySQL InnoDB table with a unique index can still contain duplicate rows—especially when indexed columns contain NULL values or when logical deletion is used—and presents several practical strategies, including schema changes and alternative locking mechanisms, to enforce true uniqueness.
Database DesignMySQLNULL handling
0 likes · 13 min read

This article explores a common MySQL InnoDB pitfall where unique indexes fail to prevent duplicate rows, explains how NULL values and logical deletion affect uniqueness, and presents practical strategies—including composite keys, delete status counters, timestamps, hash fields, and Redis locks—to enforce true uniqueness.
Database DesignMySQLNULL handling
0 likes · 14 min read


ITPUBAug 7, 2022 · Databases
This article examines a MySQL InnoDB pitfall where a unique index fails to block duplicate rows—especially when indexed columns contain NULL values or when logical deletion is used—and presents practical solutions such as adjusting index columns, adding timestamps, delete status counters, hash fields, and proper bulk‑insert strategies.
MySQLNULL handlinglogical delete
0 likes · 13 min read

This article explains why a unique index on a MySQL InnoDB table may still permit duplicate rows, especially when indexed columns contain NULL values or when logical deletion is used, and presents practical solutions such as adjusting index fields, adding timestamps, hash columns, or redesigning delete logic.
MySQLNULL handlingUnique Index
0 likes · 14 min read

This article details the common pitfalls encountered when synchronizing Oracle databases to AnalyticDB PostgreSQL, covering null versus empty string handling, data type conversion challenges, character set issues, special character processing, and comprehensive testing strategies to ensure data consistency and performance.
AnalyticDBDatabase TestingNULL handling
0 likes · 17 min read

This article explains the differences between toString() and String.valueOf() in Java, demonstrates how basic and wrapper types handle string conversion, discusses null‑value pitfalls, and provides source code analysis to guide developers on safe type casting and avoid common runtime exceptions.
JavaNULL handlingfundamentals
0 likes · 4 min read

This article explains the differences between toString() and String.valueOf() in Java, covering when each should be used, how they behave with null values, and why casting with (String) is generally discouraged, illustrated with code examples and source analysis.
JavaNULL handlingType Conversion
0 likes · 6 min read

This article compares Java's toString(), String.valueOf(), and (String) casting, explaining their differences, proper usage scenarios, handling of null values, and source code behavior to help developers choose the safest conversion method.
NULL handlingType Conversionstring.valueof
0 likes · 5 min read

This article explains why excessive null‑checking clutters Java code, distinguishes between valid and invalid null returns, and offers practical techniques such as assertions, exceptions, empty collections, the Null Object pattern, and Optional to write cleaner, safer code.
JavaNULL handlingOptional
0 likes · 6 min read


21CTOOct 8, 2021 · Backend Development
This article explains why excessive null‑checking clutters Java code, distinguishes valid versus invalid null returns, and shows how to replace them with assert statements, exceptions, empty collections, or the Null Object pattern to write cleaner, more reliable backend code.
Best PracticesJavaNULL handling
0 likes · 6 min read

This article explains how Java's Optional can replace null checks, outlines common misuse patterns, and provides practical guidelines and code examples for using Optional safely and effectively in backend development.
Best PracticesCode ExamplesJava
0 likes · 12 min read

This article explains how Objects.equals differs from a.equals when handling nulls and empty strings, analyzes the underlying source code, and clarifies the distinction between reference (a==b) and logical (a.equals(b)) comparisons in Java.
NULL handlingObjects.equalsequality
0 likes · 5 min read

This article explains why excessive null‑checking in Java code is problematic, distinguishes valid versus invalid null returns, and presents better alternatives such as assertions, throwing exceptions, returning empty collections or objects, and applying the Null Object pattern with concrete code examples.
Best PracticesException HandlingJava
0 likes · 6 min read

This article compares Java’s null, which throws NullPointerException on member access, with Groovy’s NullObject that safely handles method calls, explains the underlying implementation, demonstrates practical code examples, and shows how to customize NullObject behavior via metaClass extensions.
GroovyJavaNULL handling
0 likes · 4 min read

This article explains how MySQL executes COUNT(*) and COUNT(column) queries on InnoDB tables, showing example results, detailing each layer's processing steps, the handling of NULL values, and the subtle performance differences between the two forms.
COUNTDatabase PerformanceInnoDB
0 likes · 10 min read

This article discusses common null‑value pitfalls in Java services, explains why returning null collections is dangerous, and presents robust solutions such as returning empty lists, using Optional, applying JSR‑303/JSR‑305 annotations, and employing the Null Object pattern to improve code safety and readability.
JSR-303JSR-305Java
0 likes · 13 min read

This article examines common pitfalls of null values in Java backend code, explains why returning null collections or objects can cause NullPointerExceptions, and presents robust solutions such as returning empty collections, using Optional, applying JSR‑303 validation, JSR‑305 annotations, and the Null Object pattern to improve API safety and readability.
API DesignJSR-303JSR-305
0 likes · 13 min read

When using HttpClient for API testing, a JSONObject omits fields with null values, causing version parameters to be missing; initializing version strings to empty strings resolves the issue and ensures proper request payloads.
API testingHttpClientJava
0 likes · 5 min read

This article explores Java's handling of null references when printed or concatenated, showing how PrintStream.print and StringBuilder.append convert null values to the literal string "null" without raising exceptions, and walks through the underlying source code and bytecode.
JDK sourceNULL handlingPrintStream
0 likes · 7 min read


ITPUBJul 25, 2016 · Databases
This article demonstrates how PostgreSQL 9.5's BRIN index leverages the allnulls and hasnulls flags in its regular pages to filter out unnecessary heap page scans, dramatically improving query performance while also discussing the impact of MVCC bloat and maintenance.
BRINIndexingMVCC
0 likes · 10 min read


ITPUBMar 23, 2016 · Databases
This guide shows how NULL values break numeric calculations in PostgreSQL and demonstrates using the COALESCE function to substitute default numbers, with step‑by‑step SQL examples that turn unexpected NULL results into accurate sums.
COALESCENULL handlingPostgreSQL
0 likes · 4 min read

This article explains how variable‑length data structures are stored in databases, illustrates PostgreSQL's page and row formats, and compares the storage overhead of DEFAULT NULL versus DEFAULT '' fields, showing that NULL can reduce space dramatically when many columns are nullable.
Database DesignNULL handlingPostgreSQL
0 likes · 5 min read
